public List<String> getURIs(URI type) { List<String> uris = new ArrayList<>(); List<String> qudtURIs = UnitFactory.getInstance().getURIs(type); for (String qudtString : qudtURIs) { String uoURI = qudt2uo.get(qudtString); if (uoURI != null) { uris.add(uoURI); } } return uris; } }
public List<String> getURIs(URI type) { List<String> uris = new ArrayList<>(); List<String> qudtURIs = UnitFactory.getInstance().getURIs(type); for (String qudtString : qudtURIs) { String uoURI = qudt2uo.get(qudtString); if (uoURI != null) { uris.add(uoURI); } } return uris; } }
private void collect() { for(String newUri : unitTypeClasses) { try { Unit unitType = UnitFactory.getInstance().getUnit(namespace +newUri); if (unitType != null) availableUnitTypes.add(unitType); List<String> uris = UnitFactory.getInstance().getURIs(namespace +newUri); for(String uri : uris) { Unit unit = UnitFactory.getInstance().getUnit(uri); if (unit != null) availableUnits.add(unit); } } catch (Exception e) { LOG.warn("No entry found"); } } }
private void collect() { for(String newUri : unitTypeClasses) { try { Unit unitType = UnitFactory.getInstance().getUnit(namespace +newUri); if (unitType != null) availableUnitTypes.add(unitType); List<String> uris = UnitFactory.getInstance().getURIs(namespace +newUri); for(String uri : uris) { Unit unit = UnitFactory.getInstance().getUnit(uri); if (unit != null) availableUnits.add(unit); } } catch (Exception e) { LOG.warn("No entry found"); } } }
public Unit getUnit(URI resource) { if (resource == null) { throw new IllegalArgumentException("The URI cannot be null"); } URI mappedURI = asURI(uo2qudt.get(resource.toString())); if (mappedURI != null) { return UnitFactory.getInstance().getUnit(mappedURI); } else { return null; } }
public Unit getUnit(URI resource) { if (resource == null) { throw new IllegalArgumentException("The URI cannot be null"); } URI mappedURI = asURI(uo2qudt.get(resource.toString())); if (mappedURI != null) { return UnitFactory.getInstance().getUnit(mappedURI); } else { return null; } }
UnitProvider() { factory = UnitFactory.getInstance(); UnitCollector collector = new UnitCollector(); this.availableUnits.addAll(collector.getAvailableUnits()); this.availableUnitTypes.addAll(collector.getAvailableUnitTypes()); }
UnitProvider() { factory = UnitFactory.getInstance(); UnitCollector collector = new UnitCollector(); this.availableUnits.addAll(collector.getAvailableUnits()); this.availableUnitTypes.addAll(collector.getAvailableUnitTypes()); }