public String toString() { final StringBuilder buf = new StringBuilder( "{" ); forEach( new TObjectProcedure<E>() { private boolean first = true; public boolean execute( Object value ) { if ( first ) { first = false; } else { buf.append( ", " ); } buf.append( value ); return true; } } ); buf.append( "}" ); return buf.toString(); }
/** * Returns a new array containing the objects in the set. * * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public Object[] toArray() { Object[] result = new Object[size()]; forEach( new ToObjectArrayProceedure( result ) ); return result; }
public int hashCode() { HashProcedure p = new HashProcedure(); forEach( p ); return p.getHashCode(); }
/** * Returns a typed array of the objects in the set. * * @param a an <code>Object[]</code> value * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public <T> T[] toArray( T[] a ) { int size = size(); if ( a.length < size ) { a = (T[]) Array.newInstance( a.getClass().getComponentType(), size ); } forEach( new ToObjectArrayProceedure( a ) ); // If this collection fits in the specified array with room to // spare (i.e., the array has more elements than this // collection), the element in the array immediately following // the end of the collection is set to null. This is useful in // determining the length of this collection only if the // caller knows that this collection does not contain any null // elements.) if ( a.length > size ) { a[size] = null; } return a; }
public String toString() { final StringBuilder buf = new StringBuilder( "{" ); forEach( new TObjectProcedure<E>() { private boolean first = true; public boolean execute( Object value ) { if ( first ) { first = false; } else { buf.append( ", " ); } buf.append( value ); return true; } } ); buf.append( "}" ); return buf.toString(); }
public String toString() { final StringBuilder buf = new StringBuilder( "{" ); forEach( new TObjectProcedure<E>() { private boolean first = true; public boolean execute( Object value ) { if ( first ) { first = false; } else { buf.append( ", " ); } buf.append( value ); return true; } } ); buf.append( "}" ); return buf.toString(); }
public String toString() { final StringBuilder buf = new StringBuilder( "{" ); forEach( new TObjectProcedure<E>() { private boolean first = true; public boolean execute( Object value ) { if ( first ) { first = false; } else { buf.append( ", " ); } buf.append( value ); return true; } } ); buf.append( "}" ); return buf.toString(); }
@Override public String toString() { final StringBuilder buf = new StringBuilder( "{" ); forEach( new TObjectProcedure<E>() { private boolean first = true; @Override public boolean execute( Object value ) { if ( first ) { first = false; } else { buf.append( ", " ); } buf.append( value ); return true; } } ); buf.append( "}" ); return buf.toString(); }
public int hashCode() { HashProcedure p = new HashProcedure(); forEach( p ); return p.getHashCode(); }
/** * Returns a new array containing the objects in the set. * * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public Object[] toArray() { Object[] result = new Object[size()]; forEach( new ToObjectArrayProceedure( result ) ); return result; }
public int hashCode() { HashProcedure p = new HashProcedure(); forEach( p ); return p.getHashCode(); }
@Override public int hashCode() { HashProcedure p = new HashProcedure(); forEach( p ); return p.getHashCode(); }
/** * Returns a new array containing the objects in the set. * * @return an <code>Object[]</code> value */ @Override @SuppressWarnings({"unchecked", "rawtypes"}) public Object[] toArray() { Object[] result = new Object[size()]; forEach( new ToObjectArrayProceedure( result ) ); return result; }
public int hashCode() { HashProcedure p = new HashProcedure(); forEach( p ); return p.getHashCode(); }
/** * Returns a new array containing the objects in the set. * * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public Object[] toArray() { Object[] result = new Object[size()]; forEach( new ToObjectArrayProceedure( result ) ); return result; }
/** * Returns a new array containing the objects in the set. * * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public Object[] toArray() { Object[] result = new Object[size()]; forEach( new ToObjectArrayProceedure( result ) ); return result; }
/** * Returns a typed array of the objects in the set. * * @param a an <code>Object[]</code> value * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public <T> T[] toArray( T[] a ) { int size = size(); if ( a.length < size ) { a = (T[]) Array.newInstance( a.getClass().getComponentType(), size ); } forEach( new ToObjectArrayProceedure( a ) ); // If this collection fits in the specified array with room to // spare (i.e., the array has more elements than this // collection), the element in the array immediately following // the end of the collection is set to null. This is useful in // determining the length of this collection only if the // caller knows that this collection does not contain any null // elements.) if ( a.length > size ) { a[size] = null; } return a; }
/** * Returns a typed array of the objects in the set. * * @param a an <code>Object[]</code> value * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public <T> T[] toArray( T[] a ) { int size = size(); if ( a.length < size ) { a = (T[]) Array.newInstance( a.getClass().getComponentType(), size ); } forEach( new ToObjectArrayProceedure( a ) ); // If this collection fits in the specified array with room to // spare (i.e., the array has more elements than this // collection), the element in the array immediately following // the end of the collection is set to null. This is useful in // determining the length of this collection only if the // caller knows that this collection does not contain any null // elements.) if ( a.length > size ) { a[size] = null; } return a; }
/** * Returns a typed array of the objects in the set. * * @param a an <code>Object[]</code> value * @return an <code>Object[]</code> value */ @Override @SuppressWarnings({"unchecked", "rawtypes"}) public <T> T[] toArray( T[] a ) { int size = size(); if ( a.length < size ) { a = (T[]) Array.newInstance( a.getClass().getComponentType(), size ); } forEach( new ToObjectArrayProceedure( a ) ); // If this collection fits in the specified array with room to // spare (i.e., the array has more elements than this // collection), the element in the array immediately following // the end of the collection is set to null. This is useful in // determining the length of this collection only if the // caller knows that this collection does not contain any null // elements.) if ( a.length > size ) { a[size] = null; } return a; }
/** * Returns a typed array of the objects in the set. * * @param a an <code>Object[]</code> value * @return an <code>Object[]</code> value */ @SuppressWarnings({"unchecked"}) public <T> T[] toArray( T[] a ) { int size = size(); if ( a.length < size ) { a = (T[]) Array.newInstance( a.getClass().getComponentType(), size ); } forEach( new ToObjectArrayProceedure( a ) ); // If this collection fits in the specified array with room to // spare (i.e., the array has more elements than this // collection), the element in the array immediately following // the end of the collection is set to null. This is useful in // determining the length of this collection only if the // caller knows that this collection does not contain any null // elements.) if ( a.length > size ) { a[size] = null; } return a; }