/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public synchronized <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public synchronized <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public synchronized <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Interns an item in this instance, returning the interned instance * (which may not be the one passed in). This will add the item if no * equal item has been added. * * @param item {@code non-null;} the item to intern * @return {@code non-null;} the equivalent interned instance */ public <T extends OffsettedItem> T intern(T item) { throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) { return (T) result; } add(item); interns.put(item, item); return item; }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }
/** * Adds an item to this instance. This will in turn tell the given item * that it has been added to this instance. It is invalid to add the * same item to more than one instance, nor to add the same items * multiple times to a single instance. * * @param item {@code non-null;} the item to add */ public void add(OffsettedItem item) { throwIfPrepared(); try { if (item.getAlignment() > getAlignment()) { throw new IllegalArgumentException( "incompatible item alignment"); } } catch (NullPointerException ex) { // Elucidate the exception. throw new NullPointerException("item == null"); } items.add(item); }