Java 类com.google.common.collect.ImmutableSortedMap 实例源码

项目:Reer    文件:AbstractStructSchema.java   
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();
        }
    });
}
项目:Reer    文件:DefaultStructBindingsStore.java   
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();
}
项目:Reer    文件:DefaultStructBindings.java   
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);
}
项目:GitHub    文件:LongBits.java   
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);
            }
          }));
}
项目:tac-kbp-eal    文件:ScoreKBPAgainstERE.java   
@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;
}
项目:drift    文件:ThriftStructMetadata.java   
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"));
}
项目:boqa    文件:UberphenoOboParserTest.java   
@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());
}
项目:ontolib    文件:ImmutableOntology.java   
/**
 * 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();
}
项目:abhot    文件:CassandraDatastore.java   
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));
        }
    };
}
项目:ontolib    文件:GoOboParser.java   
/**
 * 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());
}
项目:ontolib    文件:MpoOboParser.java   
/**
 * 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());
}
项目:ontolib    文件:UberphenoOboParser.java   
/**
 * 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());
}
项目:ontolib    文件:GoOboParserTest.java   
@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());
}
项目:ontolib    文件:HpoOboParserTest.java   
@Test
public void testParseHpoHead() throws IOException {
  final HpoOboParser parser = new HpoOboParser(hpoHeadFile, true);
  final HpoOntology ontology = parser.parse();

  assertEquals(
      "ImmutableDirectedGraph [edgeLists={ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=1], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=4]], outEdges=[]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=2], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=3]], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=1]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=2]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=3]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=4]]]}, edgeCount=4]",
      ontology.getGraph().toString());
  assertEquals(
      "[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]]",
      ImmutableSortedSet.copyOf(ontology.getAllTermIds()).toString());
  assertEquals(
      "{ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], altTermIds=[], name=All, definition=null, comment=Root of all terms in the Human Phenotype Ontology., subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=UMLS:C0444868, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]], name=Mode of inheritance, definition=The pattern in which a particular genetic trait or disorder is passed from one generation to the next., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Inheritance, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=UMLS:C1708511, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]], name=Autosomal recessive inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in homozygotes. In the context of medical genetics, autosomal recessive disorders manifest in homozygotes (with two copies of the mutant allele) or compound heterozygotes (whereby each copy of a gene has a distinct mutant allele)., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal recessive, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal recessive form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal recessive predisposition, scope=RELATED, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:258211005, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0441748, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C4020899, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], altTermIds=[], name=Phenotypic abnormality, definition=A phenotypic abnormality., comment=This is the root of the phenotypic abnormality subontology of the HPO., subsets=[], synonyms=[ImmutableTermSynonym [value=Organ abnormality, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=UMLS:C4021819, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]], name=Autosomal recessive inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in homozygotes. In the context of medical genetics, autosomal recessive disorders manifest in homozygotes (with two copies of the mutant allele) or compound heterozygotes (whereby each copy of a gene has a distinct mutant allele)., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal recessive, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal recessive form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal recessive predisposition, scope=RELATED, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:258211005, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0441748, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C4020899, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]], name=Mode of inheritance, definition=The pattern in which a particular genetic trait or disorder is passed from one generation to the next., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Inheritance, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=UMLS:C1708511, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]], name=Mode of inheritance, definition=The pattern in which a particular genetic trait or disorder is passed from one generation to the next., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Inheritance, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=UMLS:C1708511, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:263681008, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0443147, description=null, trailingModifiers=null]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]], name=Autosomal recessive inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in homozygotes. In the context of medical genetics, autosomal recessive disorders manifest in homozygotes (with two copies of the mutant allele) or compound heterozygotes (whereby each copy of a gene has a distinct mutant allele)., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal recessive, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal recessive form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal recessive predisposition, scope=RELATED, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null, xrefs=[ImmutableDbxref [name=SNOMEDCT_US:258211005, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C0441748, description=null, trailingModifiers=null], ImmutableDbxref [name=UMLS:C4020899, description=null, trailingModifiers=null]]]}",
      ImmutableSortedMap.copyOf(ontology.getTermMap()).toString());
  assertEquals(
      "{1=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=1, relationQualifier=IS_A], 2=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=2, relationQualifier=IS_A], 3=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=3, relationQualifier=IS_A], 4=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=4, relationQualifier=IS_A]}",
      ImmutableSortedMap.copyOf(ontology.getRelationMap()).toString());
  assertEquals("ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]",
      ontology.getRootTermId().toString());
  assertEquals(
      "{data-version=releases/2017-04-13, saved-by=Peter Robinson, Sebastian Koehler, Sandra Doelken, Chris Mungall, Melissa Haendel, Nicole Vasilevsky, Monarch Initiative, et al.}",
      ontology.getMetaInfo().toString());
}
项目:abhot    文件:SaveAsAggregator.java   
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();
}
项目:sats-core    文件:MRVMRegionalBidderSetup.java   
/**
 * 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();
}
项目:sats-core    文件:MRVMNationalBidder.java   
private static ImmutableSortedMap<Integer, BigDecimal> buildGammaMap(Map<Integer, BigDecimal> gammaInput) {
    ImmutableSortedMap.Builder<Integer, BigDecimal> mapBuilder = ImmutableSortedMap.naturalOrder();
    SortedMap<Integer, BigDecimal> sortedInput = new TreeMap<>(gammaInput);
    Preconditions.checkArgument(sortedInput.firstKey() == 1,
            "Gamma Values must (exclusively) be specified for quantities 1 and (optionally) higher",
            sortedInput);
    Preconditions.checkArgument(sortedInput.lastKey().equals(sortedInput.size()), ""
                    + "Gamma Values must be specified for all capacities in {0, ..., k_{max}}, where k_{max} > 0 is any natural number > 0",
            sortedInput);

    for (Entry<Integer, BigDecimal> inputGammaEntry : sortedInput.entrySet()) {
        Preconditions.checkArgument(inputGammaEntry.getValue().compareTo(BigDecimal.ZERO) >= 0, "Gamma must not be negative", inputGammaEntry);
        mapBuilder.put(inputGammaEntry);
    }
    return mapBuilder.build();
}
项目:sats-core    文件:ContinuousPiecewiseLinearFunction.java   
/**
 * Constructs a new PieceWiseLinear function with a restricted domain interval
 * @param cornerPoints A map with <i>key = x-values</i> and <i> value = y-values</i>. 
 * The map has to include all corner points of the function, including lower and upper end of domain. <br>
 *
 */
public ContinuousPiecewiseLinearFunction(Map<BigDecimal, BigDecimal> cornerPoints) {
    // Sort the incoming corner points by their 
    SortedMap<BigDecimal, BigDecimal> sortedCornerPoints = new TreeMap<>(cornerPoints);
    ImmutableSortedMap.Builder<BigDecimal, LinearFunction> linearFunctionsBuilder =
            ImmutableSortedMap.naturalOrder();
    Iterator<Entry<BigDecimal, BigDecimal>> entryIterator = sortedCornerPoints.entrySet().iterator();
    Entry<BigDecimal, BigDecimal> lowerEntry = entryIterator.next();
    lowestX = lowerEntry.getKey();
    while (entryIterator.hasNext()) {
        Entry<BigDecimal, BigDecimal> upperEntry = entryIterator.next();
        if (lowerEntry.getKey().compareTo(upperEntry.getKey()) == 0) {
            // Skip linear function where the domain is empty
            // TODO log this
        } else {
            LinearFunction linearFunction = new LinearFunction(lowerEntry.getKey(), lowerEntry.getValue(), upperEntry.getKey(), upperEntry.getValue());
            linearFunctionsBuilder.put(upperEntry.getKey(), linearFunction);
            lowerEntry = upperEntry;
        }
    }
    linearFunctions = linearFunctionsBuilder.build();
}
项目:boqa    文件:ImmutableOntology.java   
/**
 * 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();
}
项目:boqa    文件:GoOboParser.java   
/**
 * 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());
}
项目:boqa    文件:HpoOboParser.java   
/**
 * 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 HpoOntology parse() throws IOException {
  final OboImmutableOntologyLoader<HpoTerm, HpoTermRelation> loader =
      new OboImmutableOntologyLoader<>(oboFile, debug);
  final HpoOboFactory factory = new HpoOboFactory();
  final ImmutableOntology<HpoTerm, HpoTermRelation> o = loader.load(factory);

  // Convert ImmutableOntology into HPOntology. The casts here are ugly and require the
  // @SuppressWarnings above but this saves us one factory layer of indirection.
  return new HpoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
      (ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
      o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
      (ImmutableMap<TermId, HpoTerm>) o.getTermMap(),
      (ImmutableMap<Integer, HpoTermRelation>) o.getRelationMap());
}
项目:boqa    文件:MpoOboParser.java   
/**
 * 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());
}
项目:boqa    文件:UberphenoOboParser.java   
/**
 * 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());
}
项目:boqa    文件:UphenoOboParser.java   
/**
 * Parse OBO file into {@link UphenoOntology} object.
 *
 * @return {@link UphenoOntology} from parsing OBO file.
 * @throws IOException In case of problems with file I/O.
 */
@SuppressWarnings("unchecked")
public UphenoOntology parse() throws IOException {
  final OboImmutableOntologyLoader<UphenoTerm, UphenoTermRelation> loader =
      new OboImmutableOntologyLoader<>(oboFile, debug);
  final UphenoOboFactory factory = new UphenoOboFactory();
  final ImmutableOntology<UphenoTerm, UphenoTermRelation> o = loader.load(factory);

  // Convert ImmutableOntology into UberphenoOntology. The casts here are ugly and require the
  // @SuppressWarnings above but this saves us one factory layer of indirection.
  return new UphenoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
      (ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
      o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
      (ImmutableMap<TermId, UphenoTerm>) o.getTermMap(),
      (ImmutableMap<Integer, UphenoTermRelation>) o.getRelationMap());
}
项目:boqa    文件:GoOboParserTest.java   
@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("createdBy=null, creationDate=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());
}
项目:boqa    文件:HpoOboParserTest.java   
@Test
public void testParseHpoHead() throws IOException {
  final HpoOboParser parser = new HpoOboParser(hpoHeadFile, true);
  final HpoOntology ontology = parser.parse();

  assertEquals(
      "ImmutableDirectedGraph [edgeLists={ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=1], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=4]], outEdges=[]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=2], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=3]], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=1]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=2]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=3]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=4]]]}, edgeCount=4]",
      ontology.getGraph().toString());
  assertEquals(
      "[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]]",
      ImmutableSortedSet.copyOf(ontology.getAllTermIds()).toString());
  assertEquals(
      "{ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], altTermIds=[], name=All, definition=null, comment=Root of all terms in the Human Phenotype Ontology., subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]], name=Mode of inheritance, definition=The pattern in which a particular genetic trait or disorder is passed from one generation to the next., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Inheritance, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]], name=Autosomal recessive inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in homozygotes. In the context of medical genetics, autosomal recessive disorders manifest in homozygotes (with two copies of the mutant allele) or compound heterozygotes (whereby each copy of a gene has a distinct mutant allele)., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal recessive, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal recessive form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal recessive predisposition, scope=RELATED, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], altTermIds=[], name=Phenotypic abnormality, definition=A phenotypic abnormality., comment=This is the root of the phenotypic abnormality subontology of the HPO., subsets=[], synonyms=[ImmutableTermSynonym [value=Organ abnormality, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]], name=Autosomal recessive inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in homozygotes. In the context of medical genetics, autosomal recessive disorders manifest in homozygotes (with two copies of the mutant allele) or compound heterozygotes (whereby each copy of a gene has a distinct mutant allele)., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal recessive, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal recessive form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal recessive predisposition, scope=RELATED, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]], name=Mode of inheritance, definition=The pattern in which a particular genetic trait or disorder is passed from one generation to the next., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Inheritance, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001453], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001461]], name=Mode of inheritance, definition=The pattern in which a particular genetic trait or disorder is passed from one generation to the next., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Inheritance, scope=EXACT, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001415], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001447], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001448], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001451], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001455], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001456], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001463]], name=Autosomal dominant inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in heterozygotes. In the context of medical genetics, an autosomal dominant disorder is caused when a single copy of the mutant allele is present. Males and females are affected equally, and can both transmit the disorder with a risk of 50% for each child of inheriting the mutant allele., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal dominant, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal dominant form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal dominant type, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]]], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]=HPOTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], altTermIds=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001416], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0001526]], name=Autosomal recessive inheritance, definition=A mode of inheritance that is observed for traits related to a gene encoded on one of the autosomes (i.e., the human chromosomes 1-22) in which a trait manifests in homozygotes. In the context of medical genetics, autosomal recessive disorders manifest in homozygotes (with two copies of the mutant allele) or compound heterozygotes (whereby each copy of a gene has a distinct mutant allele)., comment=null, subsets=[], synonyms=[ImmutableTermSynonym [value=Autosomal recessive, scope=EXACT, synonymTypeName=null, termXrefs=[]], ImmutableTermSynonym [value=Autosomal recessive form, scope=RELATED, synonymTypeName=null, termXrefs=[ImmutableTermXref [id=null, description=null]]], ImmutableTermSynonym [value=Autosomal recessive predisposition, scope=RELATED, synonymTypeName=null, termXrefs=[]]], obsolete=false, createdBy=null, creationDate=null]}",
      ImmutableSortedMap.copyOf(ontology.getTermMap()).toString());
  assertEquals(
      "{1=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=1, relationQualifier=IS_A], 2=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000006], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=2, relationQualifier=IS_A], 3=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000007], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], id=3, relationQualifier=IS_A], 4=HpoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000118], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], id=4, relationQualifier=IS_A]}",
      ImmutableSortedMap.copyOf(ontology.getRelationMap()).toString());
  assertEquals("ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]",
      ontology.getRootTermId().toString());
  assertEquals(
      "{data-version=releases/2017-04-13, saved-by=Peter Robinson, Sebastian Koehler, Sandra Doelken, Chris Mungall, Melissa Haendel, Nicole Vasilevsky, Monarch Initiative, et al.}",
      ontology.getMetaInfo().toString());
}
项目:Reer    文件:DefaultStructBindingsStore.java   
<T, D> StructBindings<T> extract(ModelType<T> publicType, Iterable<? extends ModelType<?>> internalViewTypes, ModelType<D> delegateType) {
    if (delegateType != null && Modifier.isAbstract(delegateType.getConcreteClass().getModifiers())) {
        throw new InvalidManagedTypeException(String.format("Type '%s' is not a valid managed type: delegate type must be null or a non-abstract type instead of '%s'.",
            publicType.getDisplayName(), delegateType.getDisplayName()));
    }

    Set<ModelType<?>> implementedViews = collectImplementedViews(publicType, internalViewTypes, delegateType);
    StructSchema<T> publicSchema = getStructSchema(publicType);
    Iterable<StructSchema<?>> declaredViewSchemas = getStructSchemas(Iterables.concat(Collections.singleton(publicType), internalViewTypes));
    Iterable<StructSchema<?>> implementedSchemas = getStructSchemas(implementedViews);
    StructSchema<D> delegateSchema = delegateType == null ? null : getStructSchema(delegateType);

    StructBindingExtractionContext<T> extractionContext = new StructBindingExtractionContext<T>(publicSchema, implementedSchemas, delegateSchema);

    if (!(publicSchema instanceof RuleSourceSchema)) {
        validateTypeHierarchy(extractionContext, publicType);
        for (ModelType<?> internalViewType : internalViewTypes) {
            validateTypeHierarchy(extractionContext, internalViewType);
        }
    }

    Map<String, Multimap<PropertyAccessorType, StructMethodBinding>> propertyBindings = Maps.newTreeMap();
    Set<StructMethodBinding> methodBindings = collectMethodBindings(extractionContext, propertyBindings);
    ImmutableSortedMap<String, ManagedProperty<?>> managedProperties = collectManagedProperties(extractionContext, propertyBindings);

    if (extractionContext.problems.hasProblems()) {
        throw new InvalidManagedTypeException(extractionContext.problems.format());
    }

    return new DefaultStructBindings<T>(
        publicSchema, declaredViewSchemas, implementedSchemas, delegateSchema,
        managedProperties, methodBindings
    );
}
项目:Reer    文件:CacheBackedTaskHistoryRepository.java   
@Override
public Map<String, FileCollectionSnapshot> getInputFilesSnapshot() {
    if (inputFilesSnapshot == null) {
        ImmutableSortedMap.Builder<String, FileCollectionSnapshot> builder = ImmutableSortedMap.naturalOrder();
        for (Map.Entry<String, Long> entry : inputFilesSnapshotIds.entrySet()) {
            builder.put(entry.getKey(), snapshotRepository.get(entry.getValue()));
        }
        inputFilesSnapshot = builder.build();
    }
    return inputFilesSnapshot;
}
项目:abhot    文件:RemoteDatastore.java   
@Override
public void putDataPoint(String metricName,
        ImmutableSortedMap<String, String> tags,
        DataPoint dataPoint, int ttl) throws DatastoreException
{
    DataPointKey key = new DataPointKey(metricName, tags, dataPoint.getApiDataType(), ttl);
    if ((m_prefixFilter != null) && (!metricName.startsWith(m_prefixFilter)))
        return;

    synchronized (m_mapLock)
    {
        m_dataPointMultimap.put(key, dataPoint);
    }
}
项目:Reer    文件:TaskExecutionSnapshot.java   
public TaskExecutionSnapshot(String taskClass, ImmutableSet<String> cacheableOutputProperties, ImmutableSet<String> declaredOutputFilePaths, HashCode taskClassLoaderHash, HashCode taskActionsClassLoaderHash, Map<String, Object> inputProperties, ImmutableSortedMap<String, Long> inputFilesSnapshotIds, Long discoveredFilesSnapshotId, ImmutableSortedMap<String, Long> outputFilesSnapshotIds) {
    this.taskClass = taskClass;
    this.cacheableOutputProperties = cacheableOutputProperties;
    this.declaredOutputFilePaths = declaredOutputFilePaths;
    this.taskClassLoaderHash = taskClassLoaderHash;
    this.taskActionsClassLoaderHash = taskActionsClassLoaderHash;
    this.inputProperties = inputProperties;
    this.inputFilesSnapshotIds = inputFilesSnapshotIds;
    this.discoveredFilesSnapshotId = discoveredFilesSnapshotId;
    this.outputFilesSnapshotIds = outputFilesSnapshotIds;
}
项目:abhot    文件:BlastServer.java   
@Override
public void run()
{
    logger.info("Blast Server Running");
    Stopwatch timer = Stopwatch.createStarted();

    while (m_keepRunning)
    {
        long now = System.currentTimeMillis();
        DataPoint dataPoint = m_longDataPointFactory.createDataPoint(now, 42);
        int row = RandomUtils.nextInt(0, m_numberOfRows);
        ImmutableSortedMap<String, String> tags = ImmutableSortedMap.of("row",
                String.valueOf(row), "host", "blast_server");

        try
        {
            m_datastore.putDataPoint(m_metricName, tags, dataPoint, m_ttl);
        }
        catch (DatastoreException e)
        {
            e.printStackTrace();
        }
        m_counter ++;

        if ((m_counter % 100000 == 0) && (timer.elapsed(TimeUnit.SECONDS) > m_durration))
            m_keepRunning = false;

    }
}
项目:helper    文件:ImmutableCollectors.java   
public static <T, K, V> Collector<T, ?, ImmutableSortedMap<K, V>> toSortedMap(Comparator<? super K> comparator, Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper) {
    return Collector.of(
            () -> new ImmutableSortedMap.Builder<K, V>(comparator),
            (builder, input) -> builder.put(keyMapper.apply(input), valueMapper.apply(input)),
            (l, r) -> l.putAll(r.build()),
            ImmutableSortedMap.Builder::build,
            Collector.Characteristics.UNORDERED
    );
}
项目:beadledom    文件:HealthChecker.java   
@Inject
HealthChecker(
    UriInfo uriInfo,
    ServiceMetadata serviceMetadata,
    Map<String, HealthDependency> healthDependencies) {
  this.uriInfo = uriInfo;
  this.serviceMetadata = serviceMetadata;
  this.healthDependencies = ImmutableSortedMap.copyOf(healthDependencies);
}
项目:drift    文件:AbstractReflectionThriftCodec.java   
protected AbstractReflectionThriftCodec(ThriftCodecManager manager, ThriftStructMetadata metadata)
{
    this.metadata = metadata;

    ImmutableSortedMap.Builder<Short, ThriftCodec<?>> fields = ImmutableSortedMap.naturalOrder();
    for (ThriftFieldMetadata fieldMetadata : metadata.getFields(THRIFT_FIELD)) {
        fields.put(fieldMetadata.getId(), manager.getCodec(fieldMetadata.getThriftType()));
    }
    this.fields = fields.build();
}
项目:ontolib    文件:TermAnnotationsTest.java   
@Test
public void testConstructTermAnnotationToLabelsMap() {
  Map<TermId, Collection<String>> map = ImmutableSortedMap
      .copyOf(TermAnnotations.constructTermAnnotationToLabelsMap(ontology, annotations));
  assertEquals(
      "{ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=[two, one], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000002]=[two, three, one], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000003]=[two, one], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000004]=[two, one], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005]=[two, three, one]}",
      map.toString());
}
项目:ontolib    文件:TermAnnotationsTest.java   
@Test
public void testConstructTermLabelToAnnotationsMap() {
  Map<String, Collection<TermId>> map = ImmutableSortedMap
      .copyOf(TermAnnotations.constructTermLabelToAnnotationsMap(ontology, annotations));
  assertEquals(
      "{one=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000002], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000003], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000004], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]], three=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000002], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005]], two=[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000002], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000003], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000004], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000005], ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]]}",
      map.toString());
}
项目:abhot    文件:CassandraDatastore.java   
private void putInternalDataPoint(String metricName, ImmutableSortedMap<String, String> tags, DataPoint dataPoint)
{
    try
    {
        putDataPoint(metricName, tags, dataPoint, 0);
    }
    catch (DatastoreException e)
    {
        logger.error("", e);
    }
}
项目:googles-monorepo-demo    文件:SafeTreeMapTest.java   
@GwtIncompatible // SerializableTester
public void testViewSerialization() {
  Map<String, Integer> map =
      ImmutableSortedMap.of("one", 1, "two", 2, "three", 3);
  SerializableTester.reserializeAndAssert(map.entrySet());
  SerializableTester.reserializeAndAssert(map.keySet());
  assertEquals(Lists.newArrayList(map.values()),
      Lists.newArrayList(SerializableTester.reserialize(map.values())));
}
项目:abhot    文件:KairosDatastore.java   
public void putDataPoint(String metricName,
        ImmutableSortedMap<String, String> tags,
        DataPoint dataPoint, int ttl) throws DatastoreException
{
    //Add to datastore first.
    m_datastore.putDataPoint(metricName, tags, dataPoint, ttl);

    for (DataPointListener dataPointListener : m_dataPointListeners)
    {
        dataPointListener.dataPoint(metricName, tags, dataPoint);
    }
}
项目:guava-mock    文件:SortedMapGenerators.java   
@Override
public SortedMap<String, String> create(Entry<String, String>[] entries) {
  ImmutableSortedMap.Builder<String, String> builder = ImmutableSortedMap.naturalOrder();
  for (Entry<String, String> entry : entries) {
    checkNotNull(entry);
    builder.put(entry.getKey(), entry.getValue());
  }
  return builder.build();
}