/** * Given the name of a relation, returns the item the shares the same * ItemContents. * * @param relationName the name of the relation of interest * * @return the item associated with this ItemContents in the named * relation, or null if it does not exist */ public Item getItemRelation(String relationName) { return (Item) relations.getObject(relationName); }
/** * Retrieves a relation from this utterance. * * @param name the name of the Relation * * @return the relation or null if the relation is not found */ public Relation getRelation(String name) { return (Relation) relations.getObject(name); }
/** * Convenience method that returns the named feature as a string. * * @param name the name of the feature * * @return the value associated with the name or null if the value is not * found * * @throws ClassCastException if the associated value is not a String */ public String getString(String name) { return (String) getObject(name); }
/** * Convenience method that returns the named feature as a float. * * @param name the name of the feature * * @return the value associated with the name or null if the value is not * found. * * @throws ClassCastException if the associated value is not a float */ public float getFloat(String name) { return ((Float) getObject(name)).floatValue(); }
/** * Convenience method that returns the named feature as a int. * * @param name the name of the feature * * @return the value associated with the name or null if the value is not * found * * @throws ClassCastException if the associated value is not an int. */ public int getInt(String name) { return ((Integer) getObject(name)).intValue(); }
/** * Finds the feature associated with this Path. * * @param item the item to start at * @return the feature associated or "0" if the feature was not found. */ public Object findFeature(Item item) { if (INTERPRET_PATHS) { return item.findFeature(path); } Item pitem = findItem(item); Object results = null; if (pitem != null) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("findFeature: Item [" + pitem + "], feature '" + feature + "'"); } results = pitem.getFeatures().getObject(feature); } results = (results == null) ? "0" : results; if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("findFeature: ...results = '" + results + "'"); } return results; }
results = item.getFeatures().getObject(feature);
/** * Convenience method that returns the named feature as a string. * * @param name the name of the feature * * @return the value associated with the name or null if the value is not * found * * @throws ClassCastException if the associated value is not a String */ public String getString(String name) { return (String) getObject(name); }
/** * Given the name of a relation, returns the item the shares the same * ItemContents. * * @param relationName the name of the relation of interest * * @return the item associated with this ItemContents in the named * relation, or null if it does not exist */ public Item getItemRelation(String relationName) { return (Item) relations.getObject(relationName); }
/** * Retrieves a relation from this utterance. * * @param name the name of the Relation * * @return the relation or null if the relation is not found */ public Relation getRelation(String name) { return (Relation) relations.getObject(name); }
/** * Convenience method that returns the named feature as a int. * * @param name the name of the feature * * @return the value associated with the name or null if the value is not * found * * @throws ClassCastException if the associated value is not an int. */ public int getInt(String name) { return ((Integer) getObject(name)).intValue(); }
/** * Convenience method that returns the named feature as a float. * * @param name the name of the feature * * @return the value associated with the name or null if the value is not * found. * * @throws ClassCastException if the associated value is not a float */ public float getFloat(String name) { return ((Float) getObject(name)).floatValue(); }
/** * Finds the feature associated with this Path. * * @param item the item to start at * @return the feature associated or "0" if the feature was not found. */ public Object findFeature(Item item) { if (INTERPRET_PATHS) { return item.findFeature(path); } Item pitem = findItem(item); Object results = null; if (pitem != null) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("findFeature: Item [" + pitem + "], feature '" + feature + "'"); } results = pitem.getFeatures().getObject(feature); } results = (results == null) ? "0" : results; if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("findFeature: ...results = '" + results + "'"); } return results; }
results = item.getFeatures().getObject(feature);