/** Finds index for property with specified name. * @param name of the property * @return the index or -1 if not found */ private int findIndex(String name) { int s = props.size(); for (int i = 0; i < s; i++) { Node.Property<?> p = props.get(i); if (p.getName().equals(name)) { return i; } } return -1; }
@Override public int hashCode() { Class<?> valueType = getValueType(); return getName().hashCode() * ((valueType == null) ? 1 : valueType.hashCode()); }
if (ps[j].getName().equals(name)) { exists = true;
private int columnForProperty(String propName) { for (int i = 0; i < propertyColumns.length; i++) { if (allPropertyColumns[propertyColumns[i]].getProperty().getName().equals(propName)) return i; } return -1; }
/** * Removes a property from this property set. * * @param property property to remove from this set. */ synchronized void removeProperty(T property) { properties.remove(property.getName()); }
/** * Search the properties for given property name. * The returned value is the index of property: you * have to add 1 to make it the column index because the * column with index 0 is reserved for the tree! */ private int columnForProperty(String propName) { for (int i = 0; i < prop.length; i++) { if (prop[i].getName().equals(propName)) return i; } return -1; }
/** Searches for a named property in a property set */ private static Property findProperty (PropertySet set, String name) { Property[] p = set.getProperties(); for (int i=0; i < p.length; i++) { if (p[i].getName().equals(name)) { return p[i]; } } return null; }
/** It sets name, displayName and short description. * Remembers original. */ public ProxyProperty(Node.Property[] original) { super(original[0].getValueType()); this.original = original; setName(original[0].getName()); setDisplayName(original[0].getDisplayName()); setShortDescription(original[0].getShortDescription()); }
/** It sets name, displayName and short description. * Remembers original. */ public ProxyProperty(Node.Property[] original) { super(original[0].getValueType()); this.original = original; setName(original[0].getName()); setDisplayName(original[0].getDisplayName()); setShortDescription(original[0].getShortDescription()); }
public int hashCode () { Class valueType = getValueType (); return getName ().hashCode () * ( valueType == null ? 1 : valueType.hashCode () ); }
/** * Adds a property into this property set. * * @param property property to add into this set. */ synchronized void addProperty(T property) { properties.put(property.getName(), property); }
public int hashCode () { Class valueType = getValueType (); return getName ().hashCode () * ( valueType == null ? 1 : valueType.hashCode () ); }
/** Searches for a named property in a property set */ private static Property findProperty (PropertySet set, String name) { Property[] p = set.getProperties(); for (int i=0; i < p.length; i++) { if (p[i].getName().equals(name)) { return p[i]; } } return null; }
@Override public boolean equals(Object o) { return o != null && o instanceof Property && getName().equals(((Property)o).getName()); }
/** Searches for a named property in a property set */ private static Property findProperty(PropertySet set, String name) { Property[] p = set.getProperties(); for (int i = 0; i < p.length; i++) { if (p[i].getName().equals(name)) { return p[i]; } } return null; }
private int columnForProperty(String propName) { for (int i = 0; i < propertyColumns.length; i++) { if (allPropertyColumns[propertyColumns[i]].getProperty().getName().equals(propName)) { return i; } } return -1; }
/** It sets name, displayName and short description. * Remembers original. */ public ProxyProperty(Node.Property[] original) { super(original[0].getValueType()); this.original = original; setName(original[0].getName()); setDisplayName(original[0].getDisplayName()); setShortDescription(original[0].getShortDescription()); }
/** Add several properties to this set, replacing old ones with the same names. * * @param ar properties to add */ public synchronized void put(Node.Property<?>[] ar) { for (int i = 0; i < ar.length; i++) { Node.Property<?> p = ar[i]; p = ar[i]; int indx = findIndex(p.getName()); if (indx != -1) { // replaces the original one props.set(indx, p); } else { // adds this to the end props.add(p); } } // clears computed array and fires into about change of properties refresh(); }
/** Add a property to this set, replacing any old one with the same name. * @param p the property to add * @return the property with the same name that was replaced, or <code>null</code> for a fresh insertion */ public synchronized Node.Property<?> put(Node.Property<?> p) { int indx = findIndex(p.getName()); Node.Property<?> removed; if (indx != -1) { // replaces the original one removed = props.set(indx, p); } else { // adds this to the end props.add(p); removed = null; } // clears computed array and fires into about change of properties refresh(); return removed; }
@Override public boolean equals(Object property) { // fix #32845 - check for non-matching types and also for null values // coming in input parameter 'property' if (!(property instanceof Property)) { return false; } Class<?> propValueType = ((Property) property).getValueType(); Class<?> valueType = getValueType(); if (((propValueType == null) && (valueType != null)) || ((propValueType != null) && (valueType == null))) { return false; } return ((Property) property).getName().equals(getName()) && (((propValueType == null) && (valueType == null)) || propValueType.equals(valueType)); }