converts a array list to a string builder

@param ArrayList $arrayList
@param bool      $reverse
@return StringBuilder
353617
private function arrayListToStringBuilder(ArrayList $arrayList, bool $reverse = false) {
        $stringBuilder = new StringBuilder();
        if ($reverse) {
            $stack = new Stack();
            foreach ($arrayList as $item) {
                if (null !== $item) {
                    $stack->push($item);
                }
            }
            while (!$stack->isEmpty()) {
                $stringBuilder->append($stack->pop());
            }
        } else {
            $queue = new Queue();
            foreach ($arrayList as $item) {
                if (null !== $item) {
                    $queue->enqueue($item);
                }

            }
            while (!$queue->isEmpty()) {
                $stringBuilder->append($queue->dequeue());
            }
        }
        return $stringBuilder;
    }
318136
public static <T> List<T> reverse(List<T> list) {
		Collections.reverse(list);
		return list;
	}
1098345
public OvhReverseIp ip_reverse_POST(String ip, String ipReverse, String reverse) throws IOException {
		String qPath = "/ip/{ip}/reverse";
		StringBuilder sb = path(qPath, ip);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "ipReverse", ipReverse);
		addBody(o, "reverse", reverse);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhReverseIp.class);
	}
358691
public function addAll(ArrayList $arrayList): bool {
        $added = false;
        foreach ($arrayList as $value) {
            $added |= $this->add($value);
        }
        return $added;
    }
275363
private static void reverse(int[] array, int start, int end) {
		for (int i = start, j = end; i < --j; ++i) {
			int t = array[i];
			array[i] = array[j];
			array[j] = t;
		}
	}
772038
public function reverseTransform($value)
    {
        $collection = new ArrayCollection();

        if ('' === $value || null === $value) {
            return $collection;
        }

        if (!is_string($value)) {
            throw new UnexpectedTypeException($value, 'string');
        }

        if ($this->onlyKeysInReverse) {
            $ids = \explode($this->separatorIfOnlyKeysInReverse, $value);
        } else {
            $ids = array();
            foreach (json_decode($value, true) as $subValue) {
                if (!empty($subValue[$this->arrayIdentifierName])) {
                    $ids[] = $subValue[$this->arrayIdentifierName];
                }
            }
        }

        $ids = \array_unique($ids);
        if (count($ids) == 0) {
            return $collection;
        }
        if (count($ids) > $this->maxResults) {
            throw new TransformationFailedException(
                sprintf('This collection should contain %s elements or less.', $this->maxResults)
            );
        }

        try {
            $hash = $this->getCacheHash($ids);
            if (array_key_exists($hash, $this->cachedResults)) {
                $collection = $this->cachedResults[$hash];
            } else {
                //Result not in cache

                $queryBuilderLoader = new ORMQueryBuilderLoader($this->queryBuilder);

                foreach ($queryBuilderLoader->getEntitiesByIds($this->identifier, $ids) as $entity) {
                    $collection->add($entity);
                }
                $this->cachedResults[$hash] = $collection; //Saves result in cache
            }
        } catch (\Exception $e) {
            throw new TransformationFailedException('Tranformation: Query Error');
        }

        return $collection;
    }
1277086
public function getMigrations($reverse = false)
    {
        $files = $this->laravel['files']->glob($this->getPath().'/*_*.php');

        // Once we have the array of files in the directory we will just remove the
        // extension and take the basename of the file which is all we need when
        // finding the migrations that haven't been run against the databases.
        if ($files === false) {
            return array();
        }

        $files = array_map(function ($file) {
            return str_replace('.php', '', basename($file));

        }, $files);

        // Once we have all of the formatted file names we will sort them and since
        // they all start with a timestamp this should give us the migrations in
        // the order they were actually created by the application developers.
        sort($files);

        if ($reverse) {
            return array_reverse($files);
        }

        return $files;
    }
557585
@Override
    public ListT<W,T> reverse() {

        return (ListT<W,T>) FoldableTransformerSeq.super.reverse();
    }
1009739
public static String reverse(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return new StringBuilder(value).reverse().toString();
    }
44973
private String _serializeList(List list, Set<Object> done) throws ConverterException {
	StringBuilder sb = new StringBuilder(goIn() + "<array length=" + del + list.size() + del + ">");

	ListIterator it = list.listIterator();
	while (it.hasNext()) {
	    sb.append(_serialize(it.next(), done));
	}

	sb.append(goIn() + "</array>");
	return sb.toString();
    }
860482
function reverse ($preserveKeys = false)
  {
    $this->pack ();
    $this->it = $this->array_reverse_iterator ($this->data, $preserveKeys);
    unset ($this->data);
    return $this;
  }
1315515
@Deprecated
	public static String buildEmailList(String[] list) {
		StringBuilder SB=new StringBuilder();
		int len=list.length;
		for(int c=0;c<len;c++) {
			if(c==0) SB.append('<'); else SB.append(",<");
			SB.append(list[c]).append('>');
		}
		return SB.toString();
	}
409218
function reverse (arrayLike) {
    var len = _toArrayLength(arrayLike.length);
    var result = Array(len);

    for (var i = 0, ofs = len - 1; i < len; i++) {
        result[i] = arrayLike[ofs - i];
    }

    return result;
}
1195608
public static String reverse(final String string) {

    return isEmpty(string) ? string : new StringBuilder(string).reverse().toString();
  }
108901
public String formatAsString(boolean reverse) {
        BasicBlock source = getSource();
        BasicBlock target = getTarget();

        StringBuilder buf = new StringBuilder();
        buf.append(reverse ? "REVERSE_EDGE(" : "EDGE(");
        buf.append(getLabel());
        buf.append(") type ");
        buf.append(edgeTypeToString(type));
        buf.append(" from block ");
        buf.append(reverse ? target.getLabel() : source.getLabel());
        buf.append(" to block ");
        buf.append(reverse ? source.getLabel() : target.getLabel());
        InstructionHandle sourceInstruction = source.getLastInstruction();
        InstructionHandle targetInstruction = target.getFirstInstruction();
        String exInfo = " -> ";
        if (targetInstruction == null && target.isExceptionThrower()) {
            targetInstruction = target.getExceptionThrower();
            exInfo = " => ";
        }
        if (sourceInstruction != null && targetInstruction != null) {
            buf.append(" [bytecode ");
            buf.append(sourceInstruction.getPosition());
            buf.append(exInfo);
            buf.append(targetInstruction.getPosition());
            buf.append(']');
        } else if (source.isExceptionThrower()) {
            if (type == FALL_THROUGH_EDGE) {
                buf.append(" [successful check]");
            } else {
                buf.append(" [failed check for ");
                buf.append(source.getExceptionThrower().getPosition());
                if (targetInstruction != null) {
                    buf.append(" to ");
                    buf.append(targetInstruction.getPosition());
                }
                buf.append(']');
            }
        }
        return buf.toString();
    }
533380
function reverse (arr) {
  const reversedArray = [];
  for (let i = arr.length - 1; i >= 0; i--) {
    reversedArray.push(arr[i]);
  }
  return reversedArray;
}
1060157
public function convert($str, $reverse = false)
    {
        $encoding        = $this->getEncoding();
        $convertEncoding = $this->getConvertEncoding();

        if ($convertEncoding === null) {
            throw new Exception\LogicException(
                'No convert encoding defined'
            );
        }

        if ($encoding === $convertEncoding) {
            return $str;
        }

        $fromEncoding = $reverse ? $convertEncoding : $encoding;
        $toEncoding   = $reverse ? $encoding : $convertEncoding;
        return mb_convert_encoding($str, $toEncoding, $fromEncoding);
    }