code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@Pure
public static Point2d WSG84_L1(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
} | java |
@Pure
public static Point2d WSG84_L2(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
} | java |
@Pure
public static Point2d WSG84_L3(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_3_XS,
LAMBERT_3_YS);
} | java |
public static Point2d WSG84_L4(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,
LAMBERT_4_YS);
} | java |
@Pure
public static Point2d WSG84_L93(double lambda, double phi) {
final Point2d ntfLambdaPhi = WSG84_NTFLamdaPhi(lambda, phi);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
} | java |
@SuppressWarnings({"checkstyle:parametername", "checkstyle:magicnumber",
"checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static Point2d NTFLambdaPhi_NTFLambert(double lambda, double phi, double n, double c, double Xs, double Ys) {
//----------------------------------------------------... | java |
@SuppressWarnings({"checkstyle:parametername", "checkstyle:magicnumber",
"checkstyle:localfinalvariablename", "checkstyle:localvariablename"})
private static Point2d WSG84_NTFLamdaPhi(double lambda, double phi) {
//---------------------------------------------------------
// 0) degree -> radian
final double la... | java |
@Pure
public ObjectProperty<WeakReference<Segment1D<?, ?>>> segmentProperty() {
if (this.segment == null) {
this.segment = new SimpleObjectProperty<>(this, MathFXAttributeNames.SEGMENT);
}
return this.segment;
} | java |
void set(ObjectProperty<WeakReference<Segment1D<?, ?>>> segment, DoubleProperty x, DoubleProperty y) {
this.segment = segment;
this.x = x;
this.y = y;
} | java |
@Pure
public static boolean intersectsSegmentCapsule(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double mx1, double my1, double mz1, double mx2, double my2, double mz2, double radius) {
double d = distanceSquaredSegmentSegment(
sx1, sy1, sz1, sx2, sy2, sz2,
mx1, my1, mz1, m... | java |
@Pure
public static boolean intersectsLineLine(
double x1, double y1, double z1,
double x2, double y2, double z2,
double x3, double y3, double z3,
double x4, double y4, double z4) {
double s = computeLineLineIntersectionFactor(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
return !Double.isNaN(s);
} | java |
@Pure
public static double distanceSquaredSegmentPoint(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double px, double py, double pz) {
double ratio = getPointProjectionFactorOnSegmentLine(px, py, pz, sx1, sy1, sz1, sx2, sy2, sz2);
if (ratio <= 0.)
return FunctionalPoint3D.dist... | java |
@Pure
public static double distanceSegmentPoint(
double sx1, double sy1, double sz1, double sx2, double sy2, double sz2,
double px, double py, double pz) {
double ratio = getPointProjectionFactorOnSegmentLine(px, py, pz, sx1, sy1, sz1, sx2, sy2, sz2);
if (ratio <= 0.)
return FunctionalPoint3D.distancePoi... | java |
@Pure
public static double getPointProjectionFactorOnSegmentLine(
double px, double py, double pz,
double s1x, double s1y, double s1z,
double s2x, double s2y, double s2z) {
double dx = s2x - s1x;
double dy = s2y - s1y;
double dz = s2z - s1z;
if (dx == 0. && dy == 0. && dz == 0.)
return 0.;
retu... | java |
@Pure
public static double distanceSegmentSegment(
double ax1, double ay1, double az1, double ax2, double ay2, double az2,
double bx1, double by1, double bz1, double bx2, double by2, double bz2) {
return Math.sqrt(distanceSquaredSegmentSegment(
ax1, ay1, az1, ax2, ay2, az2,
bx1, by1, bz1, bx2, by2, bz2... | java |
@Pure
public static double distanceSquaredSegmentSegment(
double ax1, double ay1, double az1, double ax2, double ay2, double az2,
double bx1, double by1, double bz1, double bx2, double by2, double bz2) {
Vector3f u = new Vector3f(ax2 - ax1, ay2 - ay1, az2 - az1);
Vector3f v = new Vector3f(bx2 - bx1, by2 - by... | java |
@Pure
public double distanceSegment(Point3D point) {
return distanceSegmentPoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java |
@Pure
public double distanceLine(Point3D point) {
return distanceLinePoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java |
@Pure
public double distanceSquaredSegment(Point3D point) {
return distanceSquaredSegmentPoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java |
@Pure
public double distanceSquaredLine(Point3D point) {
return distanceSquaredLinePoint(
getX1(), getY1(), getZ1(),
getX2(), getY2(), getZ2(),
point.getX(), point.getY(), point.getZ());
} | java |
protected boolean onBusLineAdded(BusLine line, int index) {
if (this.autoUpdate.get()) {
try {
addMapLayer(index, new BusLineLayer(line, isLayerAutoUpdated()));
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | java |
protected boolean onBusLineRemoved(BusLine line, int index) {
if (this.autoUpdate.get()) {
try {
removeMapLayerAt(index);
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | java |
@Nonnull
public static ImmutableKeyValueSource<Symbol, ByteSource> fromFileMap(
final Map<Symbol, File> fileMap) {
return new FileMapKeyToByteSource(fileMap);
} | java |
@Nonnull
public static ImmutableKeyValueSource<Symbol, ByteSource> fromPalDB(final File dbFile)
throws IOException {
return PalDBKeyValueSource.fromFile(dbFile);
} | java |
protected JTree newTree()
{
JTree tree = new JTree();
tree.setModel(newTreeModel(getModel()));
tree.setEditable(true);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addMouseListener(new MouseAdapter()
{
@Override
public void mousePressed(MouseEvent e)
... | java |
public void add(Iterator<AbstractPathElement3F> iterator) {
AbstractPathElement3F element;
while (iterator.hasNext()) {
element = iterator.next();
switch(element.type) {
case MOVE_TO:
moveTo(element.getToX(), element.getToY(), element.getToZ());
break;
case LINE_TO:
lineTo(element.getToX(), ... | java |
public double length() {
if (this.isEmpty()) return 0;
double length = 0;
PathIterator3f pi = getPathIterator(MathConstants.SPLINE_APPROXIMATION_RATIO);
AbstractPathElement3F pathElement = pi.next();
if (pathElement.type != PathElementType.MOVE_TO) {
throw new IllegalArgumentException("missi... | java |
private ImmutableMap<Integer, Integer> lightEREOffsetToEDTOffset(String document) {
final ImmutableMap.Builder<Integer, Integer> offsetMap = ImmutableMap.builder();
int EDT = 0;
// lightERE treats these as one, not two (as an XML parser would)
document = document.replaceAll("\\r\\n", "\n");
for (int... | java |
protected boolean validate(String text)
{
try
{
String[] strings = text.split(",");
for (int i = 0; i < strings.length; i++)
{
Integer.parseInt(strings[i].trim());
}
return true;
}
catch (NumberFormatException e)
{
return false;
}
} | java |
private Collection<EqClassT> getAlignedTo(final Object item) {
if (rightEquivalenceClassesToProvenances.containsKey(item)
&& leftEquivalenceClassesToProvenances.containsKey(item)) {
return ImmutableList.of((EqClassT) item);
} else {
return ImmutableList.of();
}
} | java |
public synchronized <T extends EventListener> void add(Class<T> type, T listener) {
assert listener != null;
if (this.listeners == NULL) {
// if this is the first listener added,
// initialize the lists
this.listeners = new Object[] {type, listener};
} else {
// Otherwise copy the array and add the ne... | java |
public synchronized <T extends EventListener> void remove(Class<T> type, T listener) {
assert listener != null;
// Is l on the list?
int index = -1;
for (int i = this.listeners.length - 2; i >= 0; i -= 2) {
if ((this.listeners[i] == type) && (this.listeners[i + 1].equals(listener))) {
index = i;
brea... | java |
private void writeObject(ObjectOutputStream stream) throws IOException {
final Object[] lList = this.listeners;
stream.defaultWriteObject();
// Save the non-null event listeners:
for (int i = 0; i < lList.length; i += 2) {
final Class<?> t = (Class<?>) lList[i];
final EventListener l = (EventListener) lL... | java |
@Pure
public static MathFunctionRange[] createDiscreteSet(double... values) {
final MathFunctionRange[] bounds = new MathFunctionRange[values.length];
for (int i = 0; i < values.length; ++i) {
bounds[i] = new MathFunctionRange(values[i]);
}
return bounds;
} | java |
@Pure
public static MathFunctionRange[] createSet(double... values) {
final MathFunctionRange[] bounds = new MathFunctionRange[values.length / 2];
for (int i = 0, j = 0; i < values.length; i += 2, ++j) {
bounds[j] = new MathFunctionRange(values[i], values[i + 1]);
}
return bounds;
} | java |
public Interceptor interceptToProgressResponse() {
return new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
ResponseBody body = new ForwardResponseBody(response.body... | java |
void setStartPoint(StandardRoadConnection desiredConnection) {
final StandardRoadConnection oldPoint = getBeginPoint(StandardRoadConnection.class);
if (oldPoint != null) {
oldPoint.removeConnectedSegment(this, true);
}
this.firstConnection = desiredConnection;
if (desiredConnection != null) {
final Poin... | java |
void setEndPoint(StandardRoadConnection desiredConnection) {
final StandardRoadConnection oldPoint = getEndPoint(StandardRoadConnection.class);
if (oldPoint != null) {
oldPoint.removeConnectedSegment(this, false);
}
this.lastConnection = desiredConnection;
if (desiredConnection != null) {
final Point2d ... | java |
private static <K, V> ImmutableMap<K, V> filterMapToKeysPreservingOrder(
final ImmutableMap<? extends K, ? extends V> map, Iterable<? extends K> keys) {
final ImmutableMap.Builder<K, V> ret = ImmutableMap.builder();
for (final K key : keys) {
final V value = map.get(key);
checkArgument(value !... | java |
public static Component getRootJDialog(Component component)
{
while (null != component.getParent())
{
component = component.getParent();
if (component instanceof JDialog)
{
break;
}
}
return component;
} | java |
public static Component getRootJFrame(Component component)
{
while (null != component.getParent())
{
component = component.getParent();
if (component instanceof JFrame)
{
break;
}
}
return component;
} | java |
public static Component getRootParent(Component component)
{
while (null != component.getParent())
{
component = component.getParent();
}
return component;
} | java |
public static void setIconImage(final String resourceName, final Window window)
throws IOException
{
final InputStream isLogo = ClassExtensions.getResourceAsStream(resourceName);
final BufferedImage biLogo = ImageIO.read(isLogo);
window.setIconImage(biLogo);
} | java |
@Override
@Pure
public double getDistance(Point2D<?, ?> point) {
double dist = super.getDistance(point);
dist -= this.radius;
return dist;
} | java |
public static Point3dfx convert(Tuple3D<?> tuple) {
if (tuple instanceof Point3dfx) {
return (Point3dfx) tuple;
}
return new Point3dfx(tuple.getX(), tuple.getY(), tuple.getZ());
} | java |
@SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
private <T> T fetch(final String id) {
checkNotNull(id);
checkArgument(!id.isEmpty());
final T ret = (T) idMap.get(id);
if (ret == null) {
throw new EREException(String.format("Lookup failed for id %s.", id));
}
return ret;... | java |
public void setSpecialChars(String[][] chars) {
assert chars != null : AssertMessages.notNullParameter();
this.specialChars.clear();
for (final String[] pair : chars) {
assert pair != null;
assert pair.length == 2;
assert pair[0].length() > 0;
assert pair[1].length() > 0;
this.specialChars.put(pair... | java |
public void setValidCharRange(int minValidChar, int maxValidChar) {
if (minValidChar <= maxValidChar) {
this.minValidChar = minValidChar;
this.maxValidChar = maxValidChar;
} else {
this.maxValidChar = minValidChar;
this.minValidChar = maxValidChar;
}
} | java |
@SuppressWarnings("checkstyle:magicnumber")
public String escape(CharSequence text) {
final StringBuilder result = new StringBuilder();
for (int i = 0; i < text.length(); ++i) {
final char c = text.charAt(i);
final String cs = Character.toString(c);
if (this.escapeCharacters.contains(cs)) {
// Escape... | java |
public static void shuffle(final int[] arr, final Random rng) {
// Fisher-Yates shuffle
for (int i = arr.length; i > 1; i--) {
// swap i-1 and a random spot
final int a = i - 1;
final int b = rng.nextInt(i);
final int tmp = arr[b];
arr[b] = arr[a];
arr[a] = tmp;
}
} | java |
protected void setupRoadBorders(ZoomableGraphicsContext gc, RoadPolyline element) {
final Color color = gc.rgb(getDrawingColor(element));
gc.setStroke(color);
final double width;
if (element.isWidePolyline()) {
width = 2 + gc.doc2fxSize(element.getWidth());
} else {
width = 3;
}
gc.setLineWidthInPix... | java |
protected void setupRoadInterior(ZoomableGraphicsContext gc, RoadPolyline element) {
final Color color;
if (isSelected(element)) {
color = gc.rgb(SELECTED_ROAD_COLOR);
} else {
color = gc.rgb(ROAD_COLOR);
}
gc.setStroke(color);
if (element.isWidePolyline()) {
gc.setLineWidthInMeters(element.getWidt... | java |
@Pure
public static String lowerEqualParameter(int aindex, Object avalue, Object value) {
return msg("A11", aindex, avalue, value); //$NON-NLS-1$
} | java |
@Pure
public static String lowerEqualParameters(int aindex, Object avalue, int bindex, Object bvalue) {
return msg("A3", aindex, avalue, bindex, bvalue); //$NON-NLS-1$
} | java |
@Pure
public static String outsideRangeInclusiveParameter(int parameterIndex, Object currentValue,
Object minValue, Object maxValue) {
return msg("A6", parameterIndex, currentValue, minValue, maxValue); //$NON-NLS-1$
} | java |
@Pure
@Inline(value = "AssertMessages.outsideRangeInclusiveParameter(0, $1, $2, $3)", imported = {AssertMessages.class})
public static String outsideRangeInclusiveParameter(Object currentValue,
Object minValue, Object maxValue) {
return outsideRangeInclusiveParameter(0, currentValue, minValue, maxValue);
} | java |
@Pure
@Inline(value = "AssertMessages.tooSmallArrayParameter(0, $1, $2)", imported = {AssertMessages.class})
public static String tooSmallArrayParameter(int currentSize, int expectedSize) {
return tooSmallArrayParameter(0, currentSize, expectedSize);
} | java |
@Pure
public static String tooSmallArrayParameter(int parameterIndex, int currentSize, int expectedSize) {
return msg("A5", parameterIndex, currentSize, expectedSize); //$NON-NLS-1$
} | java |
@Pure
public static ShapeElementType toESRI(Class<? extends MapElement> type) {
if (MapPolyline.class.isAssignableFrom(type)) {
return ShapeElementType.POLYLINE;
}
if (MapPolygon.class.isAssignableFrom(type)) {
return ShapeElementType.POLYGON;
}
if (MapMultiPoint.class.isAssignableFrom(type)) {
retu... | java |
@SuppressWarnings("unchecked")
public static <T, V> ImmutableMap<V, Alignment<T, T>> splitAlignmentByKeyFunction(
Alignment<? extends T, ? extends T> alignment,
Function<? super T, ? extends V> keyFunction) {
// we first determine all keys we could ever encounter to ensure we can construct our map
... | java |
protected void fireStateChange() {
if (this.listeners != null) {
final ProgressionEvent event = new ProgressionEvent(this, isRootModel());
for (final ProgressionListener listener : this.listeners.getListeners(ProgressionListener.class)) {
listener.onProgressionStateChanged(event);
}
}
} | java |
protected void fireValueChange() {
if (this.listeners != null) {
final ProgressionEvent event = new ProgressionEvent(this, isRootModel());
for (final ProgressionListener listener : this.listeners.getListeners(ProgressionListener.class)) {
listener.onProgressionValueChanged(event);
}
}
} | java |
void setValue(SubProgressionModel subTask, double newValue, String comment) {
setProperties(newValue, this.min, this.max, this.isAdjusting,
comment == null ? this.comment : comment, true, true, false,
subTask);
} | java |
void disconnectSubTask(SubProgressionModel subTask, double value, boolean overwriteComment) {
if (this.child == subTask) {
if (overwriteComment) {
final String cmt = subTask.getComment();
if (cmt != null) {
this.comment = cmt;
}
}
this.child = null;
setProperties(value, this.min, this.max... | java |
protected boolean onBusItineraryAdded(BusItinerary itinerary, int index) {
if (this.autoUpdate.get()) {
try {
addMapLayer(index, new BusItineraryLayer(itinerary, isLayerAutoUpdated()));
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | java |
protected boolean onBusItineraryRemoved(BusItinerary itinerary, int index) {
if (this.autoUpdate.get()) {
try {
removeMapLayerAt(index);
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | java |
@Pure
@SuppressWarnings("checkstyle:cyclomaticcomplexity")
public static Class<? extends MapElement> fromESRI(ShapeElementType type) {
switch (type) {
case MULTIPOINT:
case MULTIPOINT_M:
case MULTIPOINT_Z:
return MapMultiPoint.class;
case POINT:
case POINT_M:
case POINT_Z:
return MapPoint.class;
... | java |
@Pure
public Class<? extends MapElement> getMapElementType() {
if (this.elementType != null) {
return this.elementType;
}
try {
return fromESRI(getShapeElementType());
} catch (IllegalArgumentException exception) {
//
}
return null;
} | java |
protected static UUID extractUUID(AttributeProvider provider) {
AttributeValue value;
value = provider.getAttribute(UUID_ATTR);
if (value != null) {
try {
return value.getUUID();
} catch (InvalidAttributeTypeException e) {
//
} catch (AttributeNotInitializedException e) {
//
}
}
valu... | java |
protected void onShowPopup(final MouseEvent e)
{
if (e.isPopupTrigger())
{
System.out.println(e.getSource());
popupMenu.show(e.getComponent(), e.getX(), e.getY());
}
} | java |
private final Command takeExecutingCommand() {
try {
return this.commandAlreadySent.take();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
return null;
} | java |
public static void load(URL filename) throws IOException {
// Silently ignore loading query
if (disable) {
return;
}
if (URISchemeType.FILE.isURL(filename)) {
try {
load(new File(filename.toURI()));
} catch (URISyntaxException e) {
throw new FileNotFoundException(filename.toExternalForm());
... | java |
private E readPoint(int elementIndex, ShapeElementType type) throws IOException {
final boolean hasZ = type.hasZ();
final boolean hasM = type.hasM();
// Read coordinates
final double x = fromESRI_x(readLEDouble());
final double y = fromESRI_y(readLEDouble());
double z = 0;
double measure = Double.NaN;
... | java |
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
private E readPolyElement(int elementIndex, ShapeElementType type) throws IOException {
final boolean hasZ = type.hasZ();
final boolean hasM = type.hasM();
// Ignore the bounds stored inside the file
skipBytes(8 * 4);
// C... | java |
private E readMultiPatch(int elementIndex, ShapeElementType type) throws IOException {
// Ignore the bounds stored inside the file
skipBytes(8 * 4);
// Read the part count
final int partCount = readLEInt();
// Read the point count
final int pointCount = readLEInt();
// Read the parts' indexes
final i... | java |
private void readAttributesFromDBaseFile(E created_element) throws IOException {
// Read the DBF entry
if (this.dbfReader != null) {
final List<DBaseFileField> dbfColumns = this.dbfReader.getDBFFields();
// Read the record even if the shape element was not inserted into
// the database. It is necessary t... | java |
@Pure
public static double noiseValue(double value, MathFunction noiseLaw) throws MathException {
try {
double noise = Math.abs(noiseLaw.f(value));
initRandomNumberList();
noise *= uniformRandomVariableList.nextFloat();
if (uniformRandomVariableList.nextBoolea... | java |
public void setRotation(Quaternion rotation) {
this.m00 = 1.0f - 2.0f * rotation.getY() * rotation.getY() - 2.0f * rotation.getZ() * rotation.getZ();
this.m10 = 2.0f * (rotation.getX() * rotation.getY() + rotation.getW() * rotation.getZ());
this.m20 = 2.0f * (rotation.getX() * rotation.getZ() - ... | java |
public final void makeRotationMatrix(Quaternion rotation) {
this.m00 = 1.0f - 2.0f * rotation.getY() * rotation.getY() - 2.0f * rotation.getZ() * rotation.getZ();
this.m10 = 2.0f * (rotation.getX() * rotation.getY() + rotation.getW() * rotation.getZ());
this.m20 = 2.0f * (rotation.getX() * rotat... | java |
void setPosition(Point2D<?, ?> position) {
this.location = position == null ? null : new SoftReference<>(Point2d.convert(position));
} | java |
void addConnectedSegment(RoadPolyline segment, boolean attachToStartPoint) {
if (segment == null) {
return;
}
if (this.connectedSegments.isEmpty()) {
this.connectedSegments.add(new Connection(segment, attachToStartPoint));
} else {
// Compute the angle to the unit vector for the new segment
final do... | java |
int removeConnectedSegment(RoadSegment segment, boolean attachToStartPoint) {
if (segment == null) {
return -1;
}
final int idx = indexOf(segment, attachToStartPoint);
if (idx != -1) {
this.connectedSegments.remove(idx);
fireIteratorUpdate();
}
return idx;
} | java |
protected void addListeningIterator(IClockwiseIterator iterator) {
if (this.listeningIterators == null) {
this.listeningIterators = new WeakArrayList<>();
}
this.listeningIterators.add(iterator);
} | java |
protected void removeListeningIterator(IClockwiseIterator iterator) {
if (this.listeningIterators != null) {
this.listeningIterators.remove(iterator);
if (this.listeningIterators.isEmpty()) {
this.listeningIterators = null;
}
}
} | java |
protected void fireIteratorUpdate() {
if (this.listeningIterators != null) {
for (final IClockwiseIterator iterator : this.listeningIterators) {
if (iterator != null) {
iterator.dataStructureUpdated();
}
}
}
} | java |
@Pure
public static int getPreferredRoadColor(RoadType roadType, boolean useSystemValue) {
final RoadType rt = roadType == null ? RoadType.OTHER : roadType;
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
final String str = prefs.get("ROAD_COLOR... | java |
public static void setPreferredRoadColor(RoadType roadType, Integer color) {
final RoadType rt = roadType == null ? RoadType.OTHER : roadType;
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
if (color == null || color.intValue() == DEFAULT_ROAD_CO... | java |
@Pure
public static boolean getPreferredRoadInternDrawing() {
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("ROAD_INTERN_DRAWING", DEFAULT_ROAD_INTERN_DRAWING); //$NON-NLS-1$
}
return DEFAULT_ROAD_INTERN_DRAWING;
} | java |
public static void setPreferredRoadInternDrawing(Boolean draw) {
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
if (draw == null) {
prefs.remove("ROAD_INTERN_DRAWING"); //$NON-NLS-1$
} else {
prefs.putBoolean("ROAD_INTERN_DRAWING", draw)... | java |
@Pure
public static int getPreferredRoadInternColor() {
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
final String color = prefs.get("ROAD_INTERN_COLOR", null); //$NON-NLS-1$
if (color != null) {
try {
return Integer.valueOf(color);
... | java |
public static void setPreferredRoadInternColor(Integer color) {
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
if (color == null) {
prefs.remove("ROAD_INTERN_COLOR"); //$NON-NLS-1$
} else {
prefs.put("ROAD_INTERN_COLOR", Integer.toString... | java |
@Pure
public static double clamp(double v, double min, double max) {
assert min <= max : AssertMessages.lowerEqualParameters(1, min, 2, max);
if (v < min) {
return min;
}
if (v > max) {
return max;
}
return v;
} | java |
@Pure
public static double clampCyclic(double value, double min, double max) {
assert min <= max : AssertMessages.lowerEqualParameters(1, min, 2, max);
if (Double.isNaN(max) || Double.isNaN(min) || Double.isNaN(max)) {
return Double.NaN;
}
if (value < min) {
final double perimeter = max - min;
final d... | java |
public static DoubleRange getMinMax(double value1, double value2, double value3) {
// Efficient implementation of the min/max determination
final double min;
final double max;
// ---------------------------------
// Table of cases
// ---------------------------------
// a-b a-c b-c sequence min max case
... | java |
@Pure
@Inline(value = "1./Math.sin($1)", imported = {Math.class})
public static double csc(double angle) {
return 1. / Math.sin(angle);
} | java |
@Pure
@Inline(value = "1./Math.cos($1)", imported = {Math.class})
public static double sec(double angle) {
return 1. / Math.cos(angle);
} | java |
@Pure
@Inline(value = "1./Math.tan($1)", imported = {Math.class})
public static double cot(double angle) {
return 1. / Math.tan(angle);
} | java |
@Pure
@Inline(value = "1.-Math.cos($1)", imported = {Math.class})
public static double versin(double angle) {
return 1. - Math.cos(angle);
} | java |
@Pure
@Inline(value = "2.*Math.sin(($1)/2.)", imported = {Math.class})
public static double crd(double angle) {
return 2. * Math.sin(angle / 2.);
} | java |
public static Point2dfx convert(Tuple2D<?> tuple) {
if (tuple instanceof Point2dfx) {
return (Point2dfx) tuple;
}
return new Point2dfx(tuple.getX(), tuple.getY());
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.