예제 #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;
  }
예제 #2
0
 // @RubyLevelMethod(name="-")
 public RubyArray minus(RubyValue v) {
   return this.minus(v.toAry());
 }
예제 #3
0
 // @RubyLevelMethod(name="concat")
 public RubyArray concat(RubyValue v) {
   RubyArray ary = v.toAry();
   array_.addAll(ary.array_);
   return this;
 }
예제 #4
0
 // @RubyLevelMethod(name="+")
 public RubyArray plus(RubyValue v) {
   return this.plus(v.toAry());
 }
예제 #5
0
 // @RubyLevelMethod(name="<=>")
 public RubyValue compare(RubyValue v) {
   return this.compare(v.toAry());
 }