public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind) { return addFrameSlot(identifier, null, kind); }
public FrameSlot addFrameSlot(Object identifier) { return addFrameSlot(identifier, null, FrameSlotKind.Illegal); }
/** * Adds frame slot. Delegates to * {@link #addFrameSlot(java.lang.Object, java.lang.Object, FrameSlotKind) addFrameSlot} * (identifier, <code>null</code>, {@link FrameSlotKind#Illegal}). This is a slow operation that * switches to interpreter mode. * * @param identifier key for the slot - must not be {@code null} and needs proper * {@link #equals(java.lang.Object)} and {@link Object#hashCode()} implementations * @return the newly created slot * @throws IllegalArgumentException if a frame slot with the same identifier exists * @throws NullPointerException if {@code identifier} is {@code null} * @since 0.8 or earlier */ public FrameSlot addFrameSlot(Object identifier) { return addFrameSlot(identifier, null, FrameSlotKind.Illegal); }
public FrameSlot addIdentifier(String id) { return this.frameDescriptor.addFrameSlot(id); }
/** * Adds frame slot. Delegates to * {@link #addFrameSlot(java.lang.Object, java.lang.Object, FrameSlotKind) addFrameSlot} * (identifier, <code>null</code>, {@link FrameSlotKind#Illegal}). This is a slow operation that * switches to interpreter mode. Note that even if it is checked that the FrameDescriptor does * not have the slot for a given identifier before adding the slot for the given identifier it * can still fail with an {@link IllegalArgumentException} since the FrameDescriptor can be * modified concurrently. In such case consider using {@link #findOrAddFrameSlot(Object)} * instead. * * @param identifier key for the slot - must not be {@code null} and needs proper * {@link #equals(java.lang.Object)} and {@link Object#hashCode()} implementations * @return the newly created slot * @throws IllegalArgumentException if a frame slot with the same identifier exists * @throws NullPointerException if {@code identifier} is {@code null} * @since 0.8 or earlier */ public FrameSlot addFrameSlot(Object identifier) { return addFrameSlot(identifier, null, FrameSlotKind.Illegal); }
/** * Adds frame slot. Delegates to * {@link #addFrameSlot(java.lang.Object, java.lang.Object, FrameSlotKind) addFrameSlot} * (identifier, <code>null</code>, <code>kind</code>). This is a slow operation that switches to * interpreter mode. * * @param identifier key for the slot - must not be {@code null} and needs proper * {@link #equals(java.lang.Object)} and {@link Object#hashCode()} implementations * @param kind the kind of the new slot * @return the newly created slot * @throws IllegalArgumentException if a frame slot with the same identifier exists * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind) { return addFrameSlot(identifier, null, kind); }
/** * Adds frame slot. Delegates to * {@link #addFrameSlot(java.lang.Object, java.lang.Object, FrameSlotKind) addFrameSlot} * (identifier, <code>null</code>, <code>kind</code>). This is a slow operation that switches to * interpreter mode. Note that even if it is checked that the FrameDescriptor does not have the * slot for a given identifier before adding the slot for the given identifier it can still fail * with an {@link IllegalArgumentException} since the FrameDescriptor can be modified * concurrently. In such case consider using {@link #findOrAddFrameSlot(Object, FrameSlotKind)} * instead. * * @param identifier key for the slot - must not be {@code null} and needs proper * {@link #equals(java.lang.Object)} and {@link Object#hashCode()} implementations * @param kind the kind of the new slot * @return the newly created slot * @throws IllegalArgumentException if a frame slot with the same identifier exists * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind) { return addFrameSlot(identifier, null, kind); }
public FrameSlot findOrAddFrameSlot(Object identifier) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier); }
public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, kind); }
public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, info, kind); }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @return the found or newly created slot * @throws NullPointerException if {@code identifier} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier); }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, kind); }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param info info for the newly created slot * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, info, kind); }
private TRegexDFAExecutorProperties createExecutorProperties(NFA nfaArg, boolean forward, boolean searching, boolean trackCaptureGroups) { FrameDescriptor frameDescriptor = new FrameDescriptor(); FrameSlot inputFS = frameDescriptor.addFrameSlot("input", FrameSlotKind.Object); FrameSlot fromIndexFS = frameDescriptor.addFrameSlot("fromIndex", FrameSlotKind.Int); FrameSlot indexFS = frameDescriptor.addFrameSlot("index", FrameSlotKind.Int); FrameSlot maxIndexFS = frameDescriptor.addFrameSlot("maxIndex", FrameSlotKind.Int); FrameSlot curMaxIndexFS = frameDescriptor.addFrameSlot("curMaxIndex", FrameSlotKind.Int); FrameSlot successorIndexFS = frameDescriptor.addFrameSlot("successorIndex", FrameSlotKind.Int); FrameSlot resultFS = frameDescriptor.addFrameSlot("result", FrameSlotKind.Int); FrameSlot captureGroupResultFS = frameDescriptor.addFrameSlot("captureGroupResult", FrameSlotKind.Object); FrameSlot lastTransitionFS = frameDescriptor.addFrameSlot("lastTransition", FrameSlotKind.Int); FrameSlot cgDataFS = frameDescriptor.addFrameSlot("cgData", FrameSlotKind.Object); return new TRegexDFAExecutorProperties( frameDescriptor,
/** * Deeper copy of the descriptor. Copies all slots in the descriptor, but only their * {@linkplain FrameSlot#getIdentifier() identifier} and {@linkplain FrameSlot#getInfo() info} * but not their {@linkplain FrameSlot#getKind() kind}! * * @return new instance of a descriptor with copies of values from this one * @since 0.8 or earlier */ public FrameDescriptor copy() { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); for (int i = 0; i < slots.size(); i++) { FrameSlot slot = slots.get(i); clonedFrameDescriptor.addFrameSlot(slot.getIdentifier(), slot.getInfo(), FrameSlotKind.Illegal); } return clonedFrameDescriptor; }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @return the found or newly created slot * @throws NullPointerException if {@code identifier} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier); } }
public FrameDescriptor copy() { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); for (int i = 0; i < this.getSlots().size(); i++) { Object identifier = this.getSlots().get(i).getIdentifier(); clonedFrameDescriptor.addFrameSlot(identifier); } return clonedFrameDescriptor; }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, kind); } }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param info info for the newly created slot * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, info, kind); } }
/** * Deeper copy of the descriptor. Copies all slots in the descriptor, but only their * {@linkplain FrameSlot#getIdentifier() identifier} and {@linkplain FrameSlot#getInfo() info} * but not their {@linkplain FrameDescriptor#getFrameSlotKind(FrameSlot) kind}! * * @return new instance of a descriptor with copies of values from this one * @since 0.8 or earlier */ public FrameDescriptor copy() { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); for (int i = 0; i < slots.size(); i++) { FrameSlot slot = slots.get(i); clonedFrameDescriptor.addFrameSlot(slot.getIdentifier(), slot.getInfo(), FrameSlotKind.Illegal); } return clonedFrameDescriptor; } }