Get the representative Chain for this EntityInfo.
We choose the Chain with the first asym_id chain identifier after
lexicographical sorting (case insensitive),
e.g. chain A if EntityInfo is composed of chains A,B,C,D,E
@return
541905
public Chain getRepresentative() {

		List<String> chainIds = new ArrayList<>();
		for (Chain chain:chains) {
			chainIds.add(chain.getId());
		}

		Collections.sort(chainIds, String.CASE_INSENSITIVE_ORDER);

		for (Chain chain:chains) {
			if (chain.getId().equals(chainIds.get(0))) {
				return chain;
			}
		}

		logger.error("Could not find a representative chain for EntityInfo '{}'", this.toString());

		return null;
	}
428842
public String getMetonymy_mention() {
    if (EntityMention_Type.featOkTst && ((EntityMention_Type)jcasType).casFeat_metonymy_mention == null)
      jcasType.jcas.throwFeatMissing("metonymy_mention", "de.julielab.jules.types.ace.EntityMention");
    return jcasType.ll_cas.ll_getStringValue(addr, ((EntityMention_Type)jcasType).casFeatCode_metonymy_mention);}
687544
public final DeterministicKeyChain getActiveKeyChain() {
        checkState(isSupportsDeterministicChains(), "doesn't support deterministic chains");
        if (chains.isEmpty())
            throw new DeterministicUpgradeRequiredException();
        return chains.get(chains.size() - 1);
    }
479595
@Override
	public SortedSet<String> getRepresentativeDomains() {
		String url = base + "representativeDomains?cluster="+ cutoff;
		return requestRepresentativeDomains(url);
	}
622301
private SubstructureIdentifier toCanonical() {
		StructureIdentifier real = getStructureIdentifier();
		if(real != null) {
			try {
				return real.toCanonical();
			} catch (StructureException e) {
				// generate fake one if needed
			}
		}

		// No identifier set, so generate based on residues present in the structure
		List<ResidueRange> range = new ArrayList<>();
		for (Chain chain : getChains()) {
			List<Group> groups = chain.getAtomGroups();
			ListIterator<Group> groupsIt = groups.listIterator();
			if(!groupsIt.hasNext()) {
				continue; // no groups in chain
			}
			Group g = groupsIt.next();
			ResidueNumber first = g.getResidueNumber();

			//TODO Detect missing intermediate residues -sbliven, 2015-01-28
			//Already better than previous whole-chain representation

			// get last residue
			while(groupsIt.hasNext()) {
				g = groupsIt.next();
			}
			ResidueNumber last = g.getResidueNumber();

			range.add(new ResidueRange(chain.getName(),first,last));
		}
		return new SubstructureIdentifier(getPDBCode(),range);
	}
378632
public String getRelationshipName()
    {
        String ret;
        if (tableAB == null /* && multipleRelationsBetweenTables */)
        {
            ret = concatenateColumnNames(this);
            ret = ret.substring(1); // remove leading _.
        }
        else // Many-to-Many relationship
        {
            ForeignKey[] fks = tableAB.getForeignKeys().values().toArray(new ForeignKey[2]);
            ret = ForeignKey.concatenateColumnNames(fks[1]).substring(1);
        }

        String multiplicity = getTableBMultiplicity();
        if (!multiplicity.equals("one"))
            ret = StringUtility.englishPluralize(ret);
        return ret;
    }
793169
public String getDescriptionFirstSentence() {
        FeatureDescriptor fd = getFeatureDescriptor();
        if (fd == null) {
            return "";
        }

        return getTeaToolsUtils().getDescriptionFirstSentence(fd);
    }
954428
public Set<String> getChains() {
		Set<String> chains = new HashSet<String>();
		List<ResidueRange> rrs = ResidueRange.parseMultiple(getRanges());
		for (ResidueRange rr : rrs) chains.add(rr.getChainName());
		return chains;
	}

	@Override
	public String getIdentifier() {
		return getScopId();
	}

	public List<ResidueRange> getResidueRanges() {
		return ResidueRange.parseMultiple(ranges);
	}

	@Override
	public SubstructureIdentifier toCanonical() {
		return new SubstructureIdentifier(getPdbId(), ResidueRange.parseMultiple(getRanges()));
	}

	@Override
	public Structure reduce(Structure input) throws StructureException {
		return toCanonical().reduce(input);
	}

	@Override
	public Structure loadStructure(AtomCache cache) throws StructureException,
	IOException {
		return cache.getStructureForPdbId(pdbId);
	}

}
623565
public final void getEntitiesDescription( StringBuilder sb )
	{
		sb.append(toString());
		sb.append("{");
		synchronized (consumersMap)
		{
			if (!consumersMap.isEmpty())
			{
				int pos = 0;
				Iterator<AbstractMessageConsumer> consumers = consumersMap.values().iterator();
				while (consumers.hasNext())
				{
					AbstractMessageHandler handler = consumers.next();
					if (pos++ > 0)
						sb.append(",");					
					handler.getEntitiesDescription(sb);
				}
			}
		}
		synchronized (producersMap)
		{
			if (!producersMap.isEmpty())
			{
				int pos = 0;
				Iterator<AbstractMessageProducer> producers = producersMap.values().iterator();
				while (producers.hasNext())
				{
					AbstractMessageHandler handler = producers.next();
					if (pos++ > 0)
						sb.append(",");					
					handler.getEntitiesDescription(sb);
				}
			}
		}
		sb.append("}");
	}
513386
public com.google.api.ads.adwords.axis.v201809.cm.Chain[] getChains() {
        return chains;
    }
181423
private String getChainSpecification(List<Integer> modelNumbers, List<String> chainIds, int subunit) {
		if (onTheFly) {
			if (Collections.max(modelNumbers) > 1) {
				return chainIds.get(subunit) + "&symop=" + (modelNumbers.get(subunit)+1);
			} else {
				// if there is only a single symop, Jmol does not accept the symop syntax
				return chainIds.get(subunit);
			}
		} else {
			return chainIds.get(subunit) + "/" + (modelNumbers.get(subunit)+1);
		}
	}
1224536
public List<Entity<EntityMappings<T>>> getAllEntity()
   {
      List<Entity<EntityMappings<T>>> list = new ArrayList<Entity<EntityMappings<T>>>();
      List<Node> nodeList = childNode.get("entity");
      for(Node node: nodeList)
      {
         Entity<EntityMappings<T>>  type = new EntityImpl<EntityMappings<T>>(this, "entity", childNode, node);
         list.add(type);
      }
      return list;
   }
1176446
public Association getAssociationOrNull() {
		if ( association == null ) {
			if ( hostingEntity != null ) {
				OgmEntityEntryState entryState = OgmEntityEntryState.getStateFor( session, hostingEntity );
				if ( entryState.hasAssociation( associationKeyMetadata.getCollectionRole() ) ) {
					association = entryState.getAssociation( associationKeyMetadata.getCollectionRole() );
					return association;
				}
			}

			if ( association == null ) {
				association = gridDialect.getAssociation( getAssociationKey(), getAssociationContext() );
				if ( hostingEntity != null ) {
					OgmEntityEntryState.getStateFor( session, hostingEntity )
							.setAssociation( associationKeyMetadata.getCollectionRole(), association );
				}
			}
		}
		return association;
	}
350915
public List<Chain> getChains(){
		ArrayList<Chain> chains = new ArrayList<>();

		chains.addAll(polyChains);
		chains.addAll(nonPolyChains);
		chains.addAll(waterChains);

		chains.trimToSize();

		return chains;
	}
1020938
public CompoundName getFirstInChain()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "getFirstInChain");
      
    CompoundName firstInChain = collector.getFirst();
    
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "getFirstInChain", firstInChain);
      
    return firstInChain;
  }
1218729
public ChaincodeID getChaincodeID() throws InvalidArgumentException {

        try {

            if (chaincodeID == null) {

                Header header = Header.parseFrom(proposal.getHeader());
                Common.ChannelHeader channelHeader = Common.ChannelHeader.parseFrom(header.getChannelHeader());
                ChaincodeHeaderExtension chaincodeHeaderExtension = ChaincodeHeaderExtension.parseFrom(channelHeader.getExtension());
                chaincodeID = new ChaincodeID(chaincodeHeaderExtension.getChaincodeId());
            }
            return chaincodeID;

        } catch (Exception e) {
            throw new InvalidArgumentException(e);
        }

    }
390317
public String getSequenceId() {
    if (OutputElement_Type.featOkTst && ((OutputElement_Type)jcasType).casFeat_sequenceId == null)
      jcasType.jcas.throwFeatMissing("sequenceId", "edu.cmu.lti.oaqa.framework.types.OutputElement");
    return jcasType.ll_cas.ll_getStringValue(addr, ((OutputElement_Type)jcasType).casFeatCode_sequenceId);}