Beispiel #1
0
  // @RubyLevelMethod(name="&")
  public RubyArray and(RubyValue value) {
    RubyArray other = value.toAry();

    RubyArray a = new RubyArray();
    //        for (RubyValue v : array_) {
    for (Iterator iter = array_.iterator(); iter.hasNext(); ) {
      RubyValue v = (RubyValue) iter.next();
      if (other.include(v) == RubyConstant.QTRUE && a.include(v) == RubyConstant.QFALSE) {
        a.add(v);
      }
    }
    return a;
  }
Beispiel #2
0
 // @RubyLevelMethod(name="-")
 public RubyArray minus(RubyValue v) {
   return this.minus(v.toAry());
 }
Beispiel #3
0
 // @RubyLevelMethod(name="concat")
 public RubyArray concat(RubyValue v) {
   RubyArray ary = v.toAry();
   array_.addAll(ary.array_);
   return this;
 }
Beispiel #4
0
 // @RubyLevelMethod(name="+")
 public RubyArray plus(RubyValue v) {
   return this.plus(v.toAry());
 }
Beispiel #5
0
 // @RubyLevelMethod(name="<=>")
 public RubyValue compare(RubyValue v) {
   return this.compare(v.toAry());
 }