Example usage for org.apache.wicket.util.string AppendingStringBuffer delete

List of usage examples for org.apache.wicket.util.string AppendingStringBuffer delete

Introduction

In this page you can find the example usage for org.apache.wicket.util.string AppendingStringBuffer delete.

Prototype

public AppendingStringBuffer delete(final int start, int end) 

Source Link

Document

Removes the characters in a substring of this AppendingStringBuffer.

Usage

From source file:org.wicketstuff.security.swarm.actions.SwarmActionFactory.java

License:Apache License

/**
 * Builds a logically ordered comma separated string of all the actions this permission has.
 * Based on the logical and of the supplied actions. Subclasses should always return the same
 * string (action order) for the same action.
 * //from w  ww  .j a v a2 s.  c  o m
 * @param actions
 *            the internal action value
 * @return string containing all the actions.
 * 
 */
protected String buildActionString(int actions) {
    AppendingStringBuffer buff = new AppendingStringBuffer(power > 0 ? 10 * power : 10);
    // estimate 10 chars per name
    for (int i = -1; i < power; i++) {
        appendActionString(buff, actions, registeredIntActions.get(i).actions());
    }
    if (buff.length() > 0) // should always be the case
        buff.delete(buff.length() - 2, buff.length());
    return buff.toString();
}