Codota Logo
CollectionUtils.stringToArray
Code IndexAdd Codota to your IDE (free)

How to use
stringToArray
method
in
org.matsim.core.utils.collections.CollectionUtils

Best Java code snippets using org.matsim.core.utils.collections.CollectionUtils.stringToArray (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: matsim-org/matsim

@StringSetter(CONSIDERED_ACTIVITIES_FOR_RECEIVER_POINT_GRID)
public void setConsideredActivitiesForReceiverPointGrid(String consideredActivitiesForReceiverPointGridString) {
  this.setConsideredActivitiesForReceiverPointGridArray(CollectionUtils.stringToArray(consideredActivitiesForReceiverPointGridString));
}
origin: matsim-org/matsim

@StringSetter(HGV_ID_PREFIXES)
public void setHgvIdPrefixes(String hgvIdPrefixes) {		
  this.setHgvIdPrefixesArray(CollectionUtils.stringToArray(hgvIdPrefixes));
}
origin: matsim-org/matsim

@StringSetter( CONSIDERED_ACTIVITIES_FOR_DAMAGE_CALCULATION )
public void setConsideredActivitiesForDamageCalculation(String consideredActivitiesForSpatialFunctionalityString) {		
  this.setConsideredActivitiesForDamageCalculationArray(CollectionUtils.stringToArray(consideredActivitiesForSpatialFunctionalityString));
}

origin: matsim-org/matsim

public NonCarRouteDropper(MultiModalConfigGroup multiModalConfigGroup) {
  if (!multiModalConfigGroup.isDropNonCarRoutes()) {
    log.warn("Dropping of non car routes is not enabled in the config group - routes will not be dropped!");
    return;
  }
  Collections.addAll(this.modesToDrop, CollectionUtils.stringToArray(multiModalConfigGroup.getSimulatedModes()));
}
origin: matsim-org/matsim

@Override
public void addParam(final String key, final String value) {
  if( value.equals( "null" ) ) return; // old behavior of reader: keep defaults if null
  if (PT_SPEED_FACTOR.equals(key)) {
    setTeleportedModeFreespeedFactor(TransportMode.pt, Double.parseDouble(value));
  } else if (BEELINE_DISTANCE_FACTOR.equals(key)) {
    setBeelineDistanceFactor(Double.parseDouble(value));
  } else if (PT_SPEED.equals(key)) {
    setTeleportedModeSpeed(TransportMode.pt, Double.parseDouble(value));
  } else if (WALK_SPEED.equals(key)) {
    setTeleportedModeSpeed(TransportMode.walk, Double.parseDouble(value));
  } else if (BIKE_SPEED.equals(key)) {
    setTeleportedModeSpeed(TransportMode.bike, Double.parseDouble(value));
  } else if (UNDEFINED_MODE_SPEED.equals(key)) {
    setTeleportedModeSpeed(UNDEFINED, Double.parseDouble(value));
  } else if (NETWORK_MODES.equals(key)) {
    setNetworkModes(Arrays.asList(CollectionUtils.stringToArray(value)));
  } else if (key.startsWith(TELEPORTED_MODE_SPEEDS)) {
    setTeleportedModeSpeed(key.substring(TELEPORTED_MODE_SPEEDS.length()), Double.parseDouble(value));
  } else if (key.startsWith(TELEPORTED_MODE_FREESPEED_FACTORS)) {
    setTeleportedModeFreespeedFactor(key.substring(TELEPORTED_MODE_FREESPEED_FACTORS.length()), Double.parseDouble(value));
  } else {
    throw new IllegalArgumentException(key);
  }
}
origin: matsim-org/matsim

} else if (CALIBRATED_LINKS.equals(paramName) || CALIBRATED_LINES.equals(paramName) || CALIBRATED_ITEMS.equals(paramName) ) {
  this.calibratedItems.clear();
  for (String linkId : CollectionUtils.stringToArray(value)) {
    this.calibratedItems.add( linkId );
origin: matsim-org/matsim

@Test
public void testNullStringToArray() {
  String[] array = CollectionUtils.stringToArray(null);
  Assert.assertEquals(0, array.length);
}
origin: matsim-org/matsim

@Test
public void testStringToArray() {
  String[] testStrings = new String[] {
      "Aaa,Bbb,Ddd,Ccc",
      ",Aaa,Bbb,Ddd,Ccc",
      "Aaa,Bbb,Ddd,Ccc,",
      " ,Aaa,Bbb,Ddd,Ccc, ",
      " , Aaa , Bbb , Ddd , Ccc , ",
      " , Aaa ,	Bbb ,		Ddd , Ccc , ",
      ",,, Aaa ,	Bbb ,,		Ddd , Ccc ,,",
      " ,, , Aaa ,	Bbb ,,		Ddd , Ccc ,, ",
    };
  for (String str : testStrings) {
    log.info("testing String: " + str);
    String[] array = CollectionUtils.stringToArray(str);
    Assert.assertEquals(4, array.length);
    Assert.assertEquals("Aaa", array[0]);
    Assert.assertEquals("Bbb", array[1]);
    Assert.assertEquals("Ddd", array[2]);
    Assert.assertEquals("Ccc", array[3]);
  }
}
org.matsim.core.utils.collectionsCollectionUtilsstringToArray

Popular methods of CollectionUtils

  • stringToSet
  • setToString
  • arrayToString
  • idSetToString

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now