Recovers the global orientation from a string.


@param v String
@return The global orientation
420327
protected static Orientation parseGlobalOrientation(String v) {
        if (v == null) {
            return null;
        }
        if (isDirectedString(v)) {
            return Orientation.DIRECTED;
        } else if (isReversedString(v)) {
            return Orientation.REVERSED;
        } else if (isUndirectedString(v)) {
            return Orientation.UNDIRECTED;
        } else {
            throw new IllegalArgumentException(ORIENTATION_ERROR);
        }
    }
182246
private String processViewPropertySvgReference(final String viewProperty) throws IOException {
        // find start of value
        int indexOfColon = viewProperty.indexOf(':');
        if (indexOfColon > -1) {
            int indexOfValueStart = -1;
            int indexOfSQ = viewProperty.indexOf('\'',
                                                 indexOfColon + 1);
            int indexOfDQ = viewProperty.indexOf('"',
                                                 indexOfColon + 1);
            if (indexOfSQ > -1) {
                indexOfValueStart = indexOfSQ;
            } else {
                indexOfValueStart = indexOfDQ;
            }
            if (indexOfValueStart > -1) {
                String viewValue = viewProperty.substring(indexOfValueStart + 1);

                // find end of value
                int indexOfValueEnd = -1;
                indexOfSQ = viewValue.lastIndexOf('\'');
                indexOfDQ = viewValue.lastIndexOf('"');
                if (indexOfSQ > -1) {
                    indexOfValueEnd = indexOfSQ;
                } else {
                    indexOfValueEnd = indexOfDQ;
                }
                if (indexOfValueEnd > -1) {
                    viewValue = viewValue.substring(0,
                                                    indexOfValueEnd);
                    if (viewValue.endsWith(SVG_FILE_SUFFIX)) {
                        // read svg file
                        String svgContents = getReferencedSvgFileContents(viewValue);
                        if (svgContents != null) {
                            String ignorableViewProperty = viewProperty.replace("\"view\"",
                                                                                "\"_view_file\"");
                            StringBuilder newViewProperty = new StringBuilder(ignorableViewProperty).append(LINE_SEPARATOR);
                            newViewProperty.append(viewProperty.substring(0,
                                                                          indexOfValueStart));
                            newViewProperty.append("\"").append(svgContents).append("\",").append(LINE_SEPARATOR);
                            return newViewProperty.toString();
                        }
                    }
                }
            }
        }

        // property not changed, return original property
        return viewProperty + LINE_SEPARATOR;
    }
86134
private static String getFromEnvFile(String varname, String filename)
	{
		try
		{
			String	code = readFile(filename);
        	StringTokenizer stk = new StringTokenizer(code, "\n");
	        while (stk.hasMoreTokens())
        	{
            	String line = stk.nextToken().trim();
				if (line.startsWith("#")==false)
				{
					int	pos = line.indexOf(varname+"=");
					if (pos>=0)	//	Var found
						return line.substring(pos+varname.length()+1);
				}
			}
		}
		catch(Exception e) {
			//System.err.println(e);
		}
		return null;
	}
755704
public static String encodeJersey(String v)
  {
    String encoded = jerseyExtraEscape.escape(v);
    return encoded;
  }
1066943
function getTranslation(viewport) {
  let x;
  let y;

  // Modulus 360 on the rotation so that we only
  // have to worry about four possible values.
  switch(viewport.rotation % 360) {
    case 0:
      x = y = 0;
      break;
    case 90:
      x = 0;
      y = (viewport.width / viewport.scale) * -1;
      break;
    case 180:
      x = (viewport.width / viewport.scale) * -1;
      y = (viewport.height / viewport.scale) * -1;
      break;
    case 270:
      x = (viewport.height / viewport.scale) * -1;
      y = 0;
      break;
  }

  return { x, y };
}
903360
public static String toStringLow(long v) {
    final int mag = magnitude(v);
    if(mag == 0) {
      return "0";
    }
    char[] digits = new char[mag];

    long f = 1L;
    for(int pos = 0; pos < mag; ++pos, f <<= 1) {
      digits[pos] = ((v & f) == 0) ? '0' : '1';
    }
    return new String(digits);
  }
85756
public synchronized K reverseLookup(final V value) {
        if (tmap == null) {
            throw new IllegalStateException("not open");
        }
        return invTmap.findKeyForValue(value);
    }
673150
public static Locale getLocaleFromString(String localeString) {
        if (localeString == null) {
            return null;
        }
        localeString = localeString.trim();
        if (localeString.toLowerCase().equals("default")) {
            return Locale.getDefault();
        }

        // Extract language
        int languageIndex = localeString.indexOf('_');
        String language = null;
        if (languageIndex == -1) {
            // No further "_" so is "{language}" only
            return new Locale(localeString, "");
        } else {
            language = localeString.substring(0, languageIndex);
        }

        // Extract country
        int countryIndex = localeString.indexOf('_', languageIndex + 1);
        String country = null;
        if (countryIndex == -1) {
            // No further "_" so is "{language}_{country}"
            country = localeString.substring(languageIndex + 1);
            return new Locale(language, country);
        } else {
            // Assume all remaining is the variant so is "{language}_{country}_{variant}"
            country = localeString.substring(languageIndex + 1, countryIndex);
            String variant = localeString.substring(countryIndex + 1);
            return new Locale(language, country, variant);
        }
    }
895831
public Vector3f transformDirection(Vector3f v) {
        return transformDirection(v.x, v.y, v.z, v);
    }
721478
function(v, d) {
				return (v == null) ? d : (typeof(v) === "string" && v.indexOf("=") === 1) ? Number(v.split("=").join("")) + d : Number(v);
			}
974501
public static String getString(String name, String defaultVal){
        if(getConfiguration().containsKey(name)){
            return getConfiguration().getString(name);
        } else {
            return defaultVal;
        }
    }
486785
def v1(self):
        """"""
        Vm = self.system.dae.y[self.v]
        Va = self.system.dae.y[self.a]
        return polar(Vm[self.a1], Va[self.a1])
609062
protected static String getOrientation(Context ctx) {
        try {
            String o;
            switch (ctx.getResources().getConfiguration().orientation) {
                case android.content.res.Configuration.ORIENTATION_LANDSCAPE:
                    o = "landscape";
                    break;
                case android.content.res.Configuration.ORIENTATION_PORTRAIT:
                    o = "portrait";
                    break;
                default:
                    o = null;
                    break;
            }
            return o;
        } catch (Exception e) {
            Log.e(TAG, "Error getting device orientation.", e);
            return null;
        }
    }
1278654
public String getAsString(String key) {
        Object value = mValues.get(key);
        return value != null ? value.toString() : null;
    }
1298239
public static Value stringArray(@Nullable Iterable<String> v) {
    return new StringArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
  }
1051534
public static String valueToString(Object v) {
        if (v.getClass().isArray()) {
            if (v.getClass().getComponentType().isPrimitive()) {
                Class<?> c = v.getClass().getComponentType();
                if (c == int.class) {
                    return Arrays.toString((int[]) v);
                } else if (c == double.class) {
                    return Arrays.toString((double[]) v);
                } else if (c == float.class) {
                    return Arrays.toString((float[]) v);
                } else if (c == long.class) {
                    return Arrays.toString((long[]) v);
                } else if (c == byte.class) {
                    return Arrays.toString((byte[]) v);
                } else if (c == short.class) {
                    return Arrays.toString((short[]) v);
                } else {
                    return v.toString();
                }
            } else {
                return Arrays.toString((Object[]) v);
            }
        } else {
            return v.toString();
        }
    }
116939
@SuppressWarnings("unchecked")
  public E getGlobal()
  {
    ClassLoader systemLoader = getSystemClassLoader();

    if (systemLoader instanceof EnvironmentClassLoader)
      return (E) ((EnvironmentClassLoader) systemLoader).getAttribute(_varName);
    else
      return _globalValue;
  }