Package org.apache.commons.collections15

Examples of org.apache.commons.collections15.Buffer


      public String transform(String input) {
        return "<html><center>Vertex<p>"+input;
      }}}));
    vv.getRenderContext().setVertexShapeTransformer(vlasr);
    vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.red));
    vv.getRenderContext().setEdgeDrawPaintTransformer(new ConstantTransformer(Color.yellow));
    vv.getRenderContext().setEdgeStrokeTransformer(new ConstantTransformer(new BasicStroke(2.5f)));
   
    // customize the renderer
    vv.getRenderer().setVertexRenderer(new GradientVertexRenderer<String,StringBuffer>(Color.gray, Color.white, true));
    vv.getRenderer().setVertexLabelRenderer(vlasr);
View Full Code Here


      else if (object instanceof Enumeration)
         return new EnumerationIterator( (Enumeration) object);
      else if (object instanceof Collection)
         return ((Collection)object).iterator();
      else if (object.getClass().isArray())
         return new ArrayIterator(object);
      else
         return new SingletonIterator(object);
   }
View Full Code Here

      else if (object instanceof List)
         return (List) object;
      else if (object instanceof Collection)
         return new ArrayList((Collection)object);
      else if (object.getClass().isArray())
         return toList(new ArrayIterator(object), context);
      else
         return Arrays.asList( object);
        
   }
View Full Code Here

      if (object == null)
         return EmptyIterator.getInstance();
      else if (object instanceof Iterator)
         return (Iterator) object;
      else if (object instanceof Enumeration)
         return new EnumerationIterator( (Enumeration) object);
      else if (object instanceof Collection)
         return ((Collection)object).iterator();
      else if (object.getClass().isArray())
         return new ArrayIterator(object);
      else
View Full Code Here

        
   }

   public Enumeration toEnumeration(Object objects, InvocationContext context)
   {
      return new IteratorEnumeration(toIterator(objects, context));
   }
View Full Code Here

      else if (object instanceof Collection)
         return ((Collection)object).iterator();
      else if (object.getClass().isArray())
         return new ArrayIterator(object);
      else
         return new SingletonIterator(object);
   }
View Full Code Here

  @SuppressWarnings("unchecked")
  private List<InfoSaison> preMergeInfosSaison(
      final List<InfoSaison> infosSaison1,
      final List<InfoSaison> infosSaison2)
  {
    final MultiKeyMap mkMap = new MultiKeyMap();

    preMergeInfosSaison(infosSaison1, mkMap);
    preMergeInfosSaison(infosSaison2, mkMap);

    return new Vector<InfoSaison>(mkMap.values());
  }
View Full Code Here

     * Override to return a map other than HashMap as the confirmed map.
     *
     * @return a map that is known to be valid
     */
    public MultiMap makeConfirmedMap() {
        return new MultiHashMap();
    }
View Full Code Here

   * except as arguments to the q option.
   */
  static Varargs format( Varargs args ) {
    LuaString fmt = args.checkstring( 1 );
    final int n = fmt.length();
    Buffer result = new Buffer(n);
    int arg = 1;
    int c;
   
    for ( int i = 0; i < n; ) {
      switch ( c = fmt.luaByte( i++ ) ) {
      case '\n':
        result.append( "\n" );
        break;
      default:
        result.append( (byte) c );
        break;
      case L_ESC:
        if ( i < n ) {
          if ( ( c = fmt.luaByte( i ) ) == L_ESC ) {
            ++i;
            result.append( (byte)L_ESC );
          } else {
            arg++;
            FormatDesc fdsc = new FormatDesc(args, fmt, i );
            i += fdsc.length;
            switch ( fdsc.conversion ) {
            case 'c':
              fdsc.format( result, (byte)args.checkint( arg ) );
              break;
            case 'i':
            case 'd':
              fdsc.format( result, args.checkint( arg ) );
              break;
            case 'o':
            case 'u':
            case 'x':
            case 'X':
              fdsc.format( result, args.checklong( arg ) );
              break;
            case 'e':
            case 'E':
            case 'f':
            case 'g':
            case 'G':
              fdsc.format( result, args.checkdouble( arg ) );
              break;
            case 'q':
              addquoted( result, args.checkstring( arg ) );
              break;
            case 's': {
              LuaString s = args.checkstring( arg );
              if ( fdsc.precision == -1 && s.length() >= 100 ) {
                result.append( s );
              } else {
                fdsc.format( result, s );
              }
            }  break;
            default:
              error("invalid option '%"+(char)fdsc.conversion+"' to 'format'");
              break;
            }
          }
        }
      }
    }
   
    return result.tostring();
  }
View Full Code Here

    LuaString p = args.checkstring( 2 );
    LuaValue repl = args.arg( 3 );
    int max_s = args.optint( 4, srclen + 1 );
    final boolean anchor = p.length() > 0 && p.charAt( 0 ) == '^';
   
    Buffer lbuf = new Buffer( srclen );
    MatchState ms = new MatchState( args, src, p );
   
    int soffset = 0;
    int n = 0;
    while ( n < max_s ) {
      ms.reset();
      int res = ms.match( soffset, anchor ? 1 : 0 );
      if ( res != -1 ) {
        n++;
        ms.add_value( lbuf, soffset, res, repl );
      }
      if ( res != -1 && res > soffset )
        soffset = res;
      else if ( soffset < srclen )
        lbuf.append( (byte) src.luaByte( soffset++ ) );
      else
        break;
      if ( anchor )
        break;
    }
    lbuf.append( src.substring( soffset, srclen ) );
    return varargsOf(lbuf.tostring(), valueOf(n));
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections15.Buffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.