private XSSFName createAndStoreName(CTDefinedName ctName) { XSSFName name = new XSSFName(ctName, this); namedRanges.add(name); namedRangesByName.put(ctName.getName().toLowerCase(Locale.ENGLISH), name); return name; }
/** * Get the named ranges with the given name. * <i>Note:</i>Excel named ranges are case-insensitive and * this method performs a case-insensitive search. * * @param name named range name * @return list of XSSFNames with the given name. An empty list if no named ranges could be found */ @Override public List<XSSFName> getNames(String name) { return Collections.unmodifiableList(namedRangesByName.get(name.toLowerCase(Locale.ENGLISH))); }
void updateName(XSSFName name, String oldName) { if (!namedRangesByName.removeMapping(oldName.toLowerCase(Locale.ENGLISH), name)) { throw new IllegalArgumentException("Name was not found: " + name); } namedRangesByName.put(name.getNameName().toLowerCase(Locale.ENGLISH), name); }
} else { map.put(definition.getRef(), definition); expansions.put(definition.getRef().getLocalPart(), definition.getRef()); for (String unqualified : expansions.keySet()) { List<QName> names = expansions.get(unqualified); if (names.contains(new QName(unqualified))) { continue; // cannot expand unqualified if the expanded value is also unqualified
@SuppressWarnings({ "unchecked", "rawtypes" }) public Collection<VSpan> spans(long aLayerId) { if (spansByLayer.containsKey(aLayerId)) { return Collections.unmodifiableList((List) spansByLayer.get(aLayerId)); } else { return Collections.emptyList(); } }
/** * As {@link #removeName(String)} is not necessarily unique * (name + sheet index is unique), this method is more accurate. * * @param name the name to remove. * * @throws IllegalArgumentException if the named range is not a part of this XSSFWorkbook */ @Override public void removeName(Name name) { if (!namedRangesByName.removeMapping(name.getNameName().toLowerCase(Locale.ENGLISH), name) || !namedRanges.remove(name)) { throw new IllegalArgumentException("Name was not found: " + name); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) public Collection<VArc> arcs(long aLayerId) { if (arcsByLayer.containsKey(aLayerId)) { return Collections.unmodifiableList((List) arcsByLayer.get(aLayerId)); } else { return Collections.emptyList(); } }
/** * As {@link #removeName(String)} is not necessarily unique * (name + sheet index is unique), this method is more accurate. * * @param name the name to remove. * * @throws IllegalArgumentException if the named range is not a part of this XSSFWorkbook */ @Override public void removeName(Name name) { if (!namedRangesByName.removeMapping(name.getNameName().toLowerCase(Locale.ENGLISH), name) || !namedRanges.remove(name)) { throw new IllegalArgumentException("Name was not found: " + name); } }
public void add(VComment aComment) { comments.put(aComment.getVid(), aComment); }
XSSFName getBuiltInName(String builtInCode, int sheetNumber) { for (XSSFName name : namedRangesByName.get(builtInCode.toLowerCase(Locale.ENGLISH))) { if (name.getSheetIndex() == sheetNumber) { return name; } } return null; }
void updateName(XSSFName name, String oldName) { if (!namedRangesByName.removeMapping(oldName.toLowerCase(Locale.ENGLISH), name)) { throw new IllegalArgumentException("Name was not found: " + name); } namedRangesByName.put(name.getNameName().toLowerCase(Locale.ENGLISH), name); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public Collection<VSpan> spans(long aLayerId) { if (spansByLayer.containsKey(aLayerId)) { return Collections.unmodifiableList((List) spansByLayer.get(aLayerId)); } else { return Collections.emptyList(); } }
public void add(VComment aComment) { comments.put(aComment.getVid(), aComment); }
/** * Remove the first named range found with the given name. * * Note: names of named ranges are not unique (name + sheet * index is unique), so {@link #removeName(Name)} should * be used if possible. * * @param name the named range name to remove * * @throws IllegalArgumentException if no named range could be found * * @deprecated 3.16. New projects should use {@link #removeName(Name)}. */ @Override @Deprecated public void removeName(String name) { List<XSSFName> names = namedRangesByName.get(name.toLowerCase(Locale.ENGLISH)); if (names.isEmpty()) { throw new IllegalArgumentException("Named range was not found: " + name); } removeName(names.get(0)); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public Collection<VArc> arcs(long aLayerId) { if (arcsByLayer.containsKey(aLayerId)) { return Collections.unmodifiableList((List) arcsByLayer.get(aLayerId)); } else { return Collections.emptyList(); } }
private XSSFName createAndStoreName(CTDefinedName ctName) { XSSFName name = new XSSFName(ctName, this); namedRanges.add(name); namedRangesByName.put(ctName.getName().toLowerCase(Locale.ENGLISH), name); return name; }
public List<AnnotationFeature> getFeatures(String aLayerName) { return features.get(aLayerName); }
public ApacheCommonsDeckOfCards() { this.cards = ListUtils.unmodifiableList( Card.streamCards().sorted().collect(Collectors.toList())); ListValuedMap<Suit, Card> cbs = MultiMapUtils.newListValuedHashMap(); this.cards.forEach(card -> cbs.put(card.getSuit(), card)); this.cardsBySuit = MultiMapUtils.unmodifiableMultiValuedMap(cbs); }
public List<AnnotationFeature> getFeatures(String aLayerName) { return features.get(aLayerName); }
public void add(VSpan aSpan) { if (arcs.containsKey(aSpan.getVid()) || spans.containsKey(aSpan.getVid())) { throw new IllegalStateException("Annotation [" + aSpan.getVid() + "] already exists."); } spans.put(aSpan.getVid(), aSpan); annotationLayers.put(aSpan.getLayer().getId(), aSpan.getLayer()); spansByLayer.put(aSpan.getLayer().getId(), aSpan); }