@Override protected PrefixMapping createPrefixMapping() { return new PolyadicPrefixMappingImpl( this ); }
@Override public PrefixMapping setNsPrefix( String prefix, String uri ) { checkUnlocked(); getBaseMapping().setNsPrefix( prefix, uri ); return this; }
@Override protected boolean sameAs( PrefixMappingImpl other ) { return equalsByMap( other ); }
@Override public boolean hasNoMappings() { return getBaseMapping().hasNoMappings(); }
/** Add the bindings of other to our own. We defer to the general case because we have to ensure the URIs are checked. @param other the PrefixMapping whose bindings we are to add to this. */ @Override public PrefixMapping setNsPrefixes( PrefixMapping other ) { return setNsPrefixes( other.getNsPrefixMap() ); }
@Override public int numPrefixes() { return getBaseMapping().numPrefixes(); }
/** Add the bindings of other to our own. We defer to the general case because we have to ensure the URIs are checked. @param other the PrefixMapping whose bindings we are to add to this. */ @Override public PrefixMapping setNsPrefixes( PrefixMapping other ) { return setNsPrefixes( other.getNsPrefixMap() ); }
@Override public PrefixMapping removeNsPrefix( String prefix ) { checkUnlocked(); getBaseMapping().removeNsPrefix( prefix ); return this; }
@Override protected PrefixMapping createPrefixMapping() { return new PolyadicPrefixMappingImpl( this ); }
@Override public boolean hasNoMappings() { return getBaseMapping().hasNoMappings(); }
@Override protected boolean equals( PrefixMappingImpl other ) { return equalsByMap( other ); }
@Override public PrefixMapping clearNsPrefixMap() { checkUnlocked(); getBaseMapping().clearNsPrefixMap() ; return this; }
@Override protected PrefixMapping getMapping() { Graph gBase = Factory.createDefaultGraph(); Graph g1 = Factory.createDefaultGraph(); Graph g2 = Factory.createDefaultGraph(); Polyadic poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); return new PolyadicPrefixMappingImpl( poly ); }
@Override public int numPrefixes() { return getBaseMapping().numPrefixes(); }
@Override protected boolean equals( PrefixMappingImpl other ) { return equalsByMap( other ); }
@Override public PrefixMapping removeNsPrefix( String prefix ) { checkUnlocked(); getBaseMapping().removeNsPrefix( prefix ); return this; }
@Override protected PrefixMapping getMapping() { Graph gBase = Factory.createDefaultGraph(); Graph g1 = Factory.createDefaultGraph(); Graph g2 = Factory.createDefaultGraph(); Polyadic poly = new MultiUnion( new Graph[] {gBase, g1, g2} ); return new PolyadicPrefixMappingImpl( poly ); }
@Override public Map<String, String> getNsPrefixMap() { Map<String, String> result = CollectionFactory.createHashedMap(); List<Graph> graphs = poly.getSubGraphs(); for (int i = graphs.size(); i > 0;) result.putAll( graphs.get( --i ).getPrefixMapping().getNsPrefixMap() ); result.remove( "" ); result.putAll( getBaseMapping().getNsPrefixMap() ); return result; }
@Override protected boolean sameAs( PrefixMappingImpl other ) { return equalsByMap( other ); }
@Override public PrefixMapping setNsPrefix( String prefix, String uri ) { checkUnlocked(); getBaseMapping().setNsPrefix( prefix, uri ); return this; }